mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
BREAKING(unstable): Improve Deno.spawn() stdio API (#14919)
- "SpawnOutput" extends "ChildStatus" instead of composing it - "SpawnOutput::stdout", "SpawnOutput::stderr", "Child::stdin", "Child::stdout" and "Child::stderr" are no longer optional, instead made them getters that throw at runtime if that stream wasn't set to "piped". - Remove the complicated "<T extends SpawnOptions = SpawnOptions>" which we currently need to give proper type hints for the availability of these fields. Their typings for these would get increasingly complex if it became dependent on more options (e.g. "SpawnOptions::pty" which if set should make the stdio streams unavailable)
This commit is contained in:
parent
0f6b455c96
commit
45c49034a7
14 changed files with 176 additions and 149 deletions
|
@ -185,14 +185,14 @@ Deno.test(
|
|||
permissions: { run: true, read: true },
|
||||
},
|
||||
async function canExitWhileListeningToSignal() {
|
||||
const { status } = await Deno.spawn(Deno.execPath(), {
|
||||
const { code } = await Deno.spawn(Deno.execPath(), {
|
||||
args: [
|
||||
"eval",
|
||||
"--unstable",
|
||||
"Deno.addSignalListener('SIGINT', () => {})",
|
||||
],
|
||||
});
|
||||
assertEquals(status.code, 0);
|
||||
assertEquals(code, 0);
|
||||
},
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue