diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2022-07-18 14:16:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-18 15:16:12 +0200 |
commit | 45c49034a7ea20f27287cd8559ea050d8973bfae (patch) | |
tree | 4566c3ca296f49e6bb564693f0e18e141304a3d4 /cli/tests/unit/remove_test.ts | |
parent | 0f6b455c964933692f4c82476692ab66eba242c2 (diff) |
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)
Diffstat (limited to 'cli/tests/unit/remove_test.ts')
-rw-r--r-- | cli/tests/unit/remove_test.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/tests/unit/remove_test.ts b/cli/tests/unit/remove_test.ts index 365cc4e45..01f2e3fda 100644 --- a/cli/tests/unit/remove_test.ts +++ b/cli/tests/unit/remove_test.ts @@ -262,12 +262,12 @@ if (Deno.build.os === "windows") { Deno.test( { permissions: { run: true, write: true, read: true } }, async function removeFileSymlink() { - const { status } = await Deno.spawn("cmd", { + const { success } = await Deno.spawn("cmd", { args: ["/c", "mklink", "file_link", "bar"], stdout: "null", }); - assert(status.success); + assert(success); await Deno.remove("file_link"); await assertRejects(async () => { await Deno.lstat("file_link"); @@ -278,12 +278,12 @@ if (Deno.build.os === "windows") { Deno.test( { permissions: { run: true, write: true, read: true } }, async function removeDirSymlink() { - const { status } = await Deno.spawn("cmd", { + const { success } = await Deno.spawn("cmd", { args: ["/c", "mklink", "/d", "dir_link", "bar"], stdout: "null", }); - assert(status.success); + assert(success); await Deno.remove("dir_link"); await assertRejects(async () => { await Deno.lstat("dir_link"); |