diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2022-11-04 04:00:53 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-04 04:00:53 +0900 |
commit | 6fe9428805f80222daaf4ccdf9995f2e53b511ff (patch) | |
tree | 0a6c26a8b90c305dcc3459a8b786e228cb0d3ee8 /cli/tests | |
parent | dae3940519d626ddfeb954e3f3d7ebe8b83067bf (diff) |
fix(runtime): fix Deno.hostname on windows (#16530)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/os_test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/tests/unit/os_test.ts b/cli/tests/unit/os_test.ts index a7329ddb4..04ddf8ae0 100644 --- a/cli/tests/unit/os_test.ts +++ b/cli/tests/unit/os_test.ts @@ -208,6 +208,18 @@ Deno.test( }, ); +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(), { + args: ["eval", "-p", "Deno.hostname()"], + }); + const hostname = new TextDecoder().decode(stdout).trim(); + assert(hostname.length > 0); + }, +); + Deno.test({ permissions: { sys: false } }, function hostnamePerm() { assertThrows(() => { Deno.hostname(); |