Add failed test back (#17384)

This commit is contained in:
fisker Cheung authored and GitHub committed 2025-04-22 17:17:47 +08:00
1 parent 6f4c89f8f9
commit 05a5ff54d0
4 files changed
+25 -7

No files matched your search

-2
View File
@@ -55,8 +55,6 @@ if (SKIP_TESTS_WITH_NEW_SYNTAX) {
"<rootDir>/tests/integration/__tests__/config-invalid.js",
// Fails on Node.js v14
"<rootDir>/tests/dts/unit/run.js",
// Unknown reason, fails on Node.js v14
"<rootDir>/tests/integration/__tests__/config-file-typescript.js",
);
}
@@ -1,2 +1,2 @@
# dynamically created by tests
*
test-*
@@ -1,2 +1,2 @@
# dynamically created by tests
*
test-*
+23 -3
View File
@@ -10,6 +10,7 @@ const CLI_WORKER_FILE = url.fileURLToPath(
const INTEGRATION_TEST_DIRECTORY = url.fileURLToPath(
new URL("./", import.meta.url),
);
const IS_CI = Boolean(process.env.CI);
const removeFinalNewLine = (string) =>
string.endsWith("\n") ? string.slice(0, -1) : string;
const SUPPORTS_DISABLE_WARNING_FLAG =
@@ -39,7 +40,6 @@ function runCliWorker(dir, args, options) {
NO_COLOR: "1",
},
});
worker.unref();
worker.on("message", ({ action, data }) => {
if (action === "write-file") {
@@ -70,7 +70,27 @@ function runCliWorker(dir, args, options) {
reject(error);
});
worker.send(options);
worker.send(options, (error) => {
if (!error) {
return;
}
// It can fail with `write EPIPE` error when running node with unsupported flags like `--experimental-strip-types`
// Let's ignore and wait for the `close` event
if (
error.code === "EPIPE" &&
error.syscall === "write" &&
nodeOptions.length > 0
) {
if (IS_CI) {
// eslint-disable-next-line no-console
console.error(Object.assign(error, { dir, args, options, worker }));
}
return;
}
reject(error);
});
});
}
@@ -130,7 +150,7 @@ function runCli(dir, args = [], options = {}) {
expect(value).toEqual(testOptions[name]);
}
} else {
snapshot = snapshot || {};
snapshot = snapshot ?? {};
snapshot[name] = value;
}
}