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/testdata/045_proxy_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/testdata/045_proxy_test.ts')
-rw-r--r-- | cli/tests/testdata/045_proxy_test.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cli/tests/testdata/045_proxy_test.ts b/cli/tests/testdata/045_proxy_test.ts index 620e23e14..6a4e72aff 100644 --- a/cli/tests/testdata/045_proxy_test.ts +++ b/cli/tests/testdata/045_proxy_test.ts @@ -31,7 +31,7 @@ async function handler(req: Request): Promise<Response> { } async function testFetch() { - const { status } = await Deno.spawn(Deno.execPath(), { + const { code } = await Deno.spawn(Deno.execPath(), { args: [ "run", "--quiet", @@ -44,11 +44,11 @@ async function testFetch() { }, }); - assertEquals(status.code, 0); + assertEquals(code, 0); } async function testModuleDownload() { - const { status } = await Deno.spawn(Deno.execPath(), { + const { code } = await Deno.spawn(Deno.execPath(), { args: [ "cache", "--reload", @@ -60,11 +60,11 @@ async function testModuleDownload() { }, }); - assertEquals(status.code, 0); + assertEquals(code, 0); } async function testFetchNoProxy() { - const { status } = await Deno.spawn(Deno.execPath(), { + const { code } = await Deno.spawn(Deno.execPath(), { args: [ "run", "--quiet", @@ -78,11 +78,11 @@ async function testFetchNoProxy() { }, }); - assertEquals(status.code, 0); + assertEquals(code, 0); } async function testModuleDownloadNoProxy() { - const { status } = await Deno.spawn(Deno.execPath(), { + const { code } = await Deno.spawn(Deno.execPath(), { args: [ "cache", "--reload", @@ -95,11 +95,11 @@ async function testModuleDownloadNoProxy() { }, }); - assertEquals(status.code, 0); + assertEquals(code, 0); } async function testFetchProgrammaticProxy() { - const { status } = await Deno.spawn(Deno.execPath(), { + const { code } = await Deno.spawn(Deno.execPath(), { args: [ "run", "--quiet", @@ -109,7 +109,7 @@ async function testFetchProgrammaticProxy() { "045_programmatic_proxy_client.ts", ], }); - assertEquals(status.code, 0); + assertEquals(code, 0); } proxyServer(); |