Add failed test back (#17384)
This commit is contained in:
1 parent
6f4c89f8f9
commit
05a5ff54d0
4 files changed
+25
-7
No files matched your search
@@ -55,8 +55,6 @@ if (SKIP_TESTS_WITH_NEW_SYNTAX) {
|
|||||||
"<rootDir>/tests/integration/__tests__/config-invalid.js",
|
"<rootDir>/tests/integration/__tests__/config-invalid.js",
|
||||||
// Fails on Node.js v14
|
// Fails on Node.js v14
|
||||||
"<rootDir>/tests/dts/unit/run.js",
|
"<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
|
# dynamically created by tests
|
||||||
*
|
test-*
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
# dynamically created by tests
|
# dynamically created by tests
|
||||||
*
|
test-*
|
||||||
@@ -10,6 +10,7 @@ const CLI_WORKER_FILE = url.fileURLToPath(
|
|||||||
const INTEGRATION_TEST_DIRECTORY = url.fileURLToPath(
|
const INTEGRATION_TEST_DIRECTORY = url.fileURLToPath(
|
||||||
new URL("./", import.meta.url),
|
new URL("./", import.meta.url),
|
||||||
);
|
);
|
||||||
|
const IS_CI = Boolean(process.env.CI);
|
||||||
const removeFinalNewLine = (string) =>
|
const removeFinalNewLine = (string) =>
|
||||||
string.endsWith("\n") ? string.slice(0, -1) : string;
|
string.endsWith("\n") ? string.slice(0, -1) : string;
|
||||||
const SUPPORTS_DISABLE_WARNING_FLAG =
|
const SUPPORTS_DISABLE_WARNING_FLAG =
|
||||||
@@ -39,7 +40,6 @@ function runCliWorker(dir, args, options) {
|
|||||||
NO_COLOR: "1",
|
NO_COLOR: "1",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
worker.unref();
|
|
||||||
|
|
||||||
worker.on("message", ({ action, data }) => {
|
worker.on("message", ({ action, data }) => {
|
||||||
if (action === "write-file") {
|
if (action === "write-file") {
|
||||||
@@ -70,7 +70,27 @@ function runCliWorker(dir, args, options) {
|
|||||||
reject(error);
|
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]);
|
expect(value).toEqual(testOptions[name]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snapshot = snapshot || {};
|
snapshot = snapshot ?? {};
|
||||||
snapshot[name] = value;
|
snapshot[name] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user