summaryrefslogtreecommitdiff
path: root/cli/tests/unit/os_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/os_test.ts')
-rw-r--r--cli/tests/unit/os_test.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/tests/unit/os_test.ts b/cli/tests/unit/os_test.ts
index 04ddf8ae0..72e0b57ba 100644
--- a/cli/tests/unit/os_test.ts
+++ b/cli/tests/unit/os_test.ts
@@ -74,10 +74,10 @@ Deno.test(
console.log(
${JSON.stringify(Object.keys(expectedEnv))}.map(k => Deno.env.get(k))
)`;
- const { success, stdout } = await Deno.spawn(Deno.execPath(), {
+ const { success, stdout } = await new Deno.Command(Deno.execPath(), {
args: ["eval", src],
env: { ...inputEnv, NO_COLOR: "1" },
- });
+ }).output();
assertEquals(success, true);
const expectedValues = Object.values(expectedEnv);
const actualValues = JSON.parse(new TextDecoder().decode(stdout));
@@ -162,10 +162,10 @@ Deno.test(
{ permissions: { run: true, read: true } },
async function osPpidIsEqualToPidOfParentProcess() {
const decoder = new TextDecoder();
- const { stdout } = await Deno.spawn(Deno.execPath(), {
+ const { stdout } = await new Deno.Command(Deno.execPath(), {
args: ["eval", "-p", "--unstable", "Deno.ppid"],
env: { NO_COLOR: "true" },
- });
+ }).output();
const expected = Deno.pid;
const actual = parseInt(decoder.decode(stdout));
@@ -212,9 +212,9 @@ Deno.test(
{ permissions: { run: [Deno.execPath()], read: true } },
// See https://github.com/denoland/deno/issues/16527
async function hostnameWithoutOtherNetworkUsages() {
- const { stdout } = await Deno.spawn(Deno.execPath(), {
+ const { stdout } = await new Deno.Command(Deno.execPath(), {
args: ["eval", "-p", "Deno.hostname()"],
- });
+ }).output();
const hostname = new TextDecoder().decode(stdout).trim();
assert(hostname.length > 0);
},