mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
fix(runner): scope internal Node notices to the supervisor (#7020)
This commit is contained in:
1 parent
d9189aebc4
commit
c94bd27e85
2 files changed
+31
No files matched your search
@@ -8,6 +8,10 @@ let shutdownSignal;
|
||||
const supervisor = spawn(
|
||||
process.execPath,
|
||||
[
|
||||
// SQLite and Windows source transforms are internal supervisor APIs. This
|
||||
// process-only flag keeps their notices out of command stderr without
|
||||
// changing the command's arguments, environment, or warning behavior.
|
||||
"--disable-warning=ExperimentalWarning",
|
||||
fileURLToPath(new URL("./run-exclusive-command.mjs", import.meta.url)),
|
||||
...process.argv.slice(2),
|
||||
],
|
||||
|
||||
@@ -318,6 +318,33 @@ it("preserves executable arguments through the public runner", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves command stderr, warnings and exit status independently of supervisor notices", async () => {
|
||||
const directory = await createTestTempDirectory("rea-runner-diagnostics-");
|
||||
const stderr = 'authored command stderr: \"quotes\" & 雪\n';
|
||||
const result = await execute(directory, process.execPath, [
|
||||
"-e",
|
||||
`
|
||||
process.stdout.write(JSON.stringify({
|
||||
disabledWarnings: process.execArgv.filter((argument) => argument.startsWith("--disable-warning")),
|
||||
}));
|
||||
process.stderr.write(${JSON.stringify(stderr)});
|
||||
process.emitWarning("authored command experiment", { type: "ExperimentalWarning" });
|
||||
process.emitWarning("authored command deprecation", { type: "DeprecationWarning" });
|
||||
process.exitCode = 7;
|
||||
`,
|
||||
]);
|
||||
expect(result.code).toBe(7);
|
||||
expect(JSON.parse(result.stdout)).toEqual({ disabledWarnings: [] });
|
||||
expect(result.stderr).toContain(stderr);
|
||||
expect(result.stderr).toContain(
|
||||
"ExperimentalWarning: authored command experiment",
|
||||
);
|
||||
expect(result.stderr).toContain(
|
||||
"DeprecationWarning: authored command deprecation",
|
||||
);
|
||||
expect(result.stderr).not.toContain("stripTypeScriptTypes");
|
||||
});
|
||||
|
||||
it.runIf(process.platform === "win32")(
|
||||
"launches an executable from a path containing spaces",
|
||||
async () => {
|
||||
|
||||
Reference in new issue
Block a user