fix: dev cmd didn't watch files due to import mangling
Appearently the esModuleInterop flag in TypeScript is not compatible with node-watch, and the import helper was mangling the import as a result and causing an error in the dev command that resulted in files not being watched. This fixes that import issue and adds an e2e test to help prevent a regression of this issue in the future.
This commit is contained in:
parent
af44f1ebf2
commit
b559d5e21a
7 changed files with 200 additions and 5 deletions
23
test/run-e2e.ts
Normal file
23
test/run-e2e.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { fork } from "child_process";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
|
||||
import { shuffle } from "./lib/utils";
|
||||
|
||||
const TEST_SUITES_DIR = path.join(__dirname, "e2e");
|
||||
const files = fs.readdirSync(TEST_SUITES_DIR);
|
||||
// Shuffle test suites to detect ordering dependencies between them.
|
||||
shuffle(files);
|
||||
for (const file of files) {
|
||||
const fullPath = path.join(TEST_SUITES_DIR, file);
|
||||
fork(path.relative(process.cwd(), fullPath)).on("exit", (code) => {
|
||||
if (code !== 0) {
|
||||
process.exitCode = 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue