diff options
Diffstat (limited to 'cli/tests/unit/globals_test.ts')
-rw-r--r-- | cli/tests/unit/globals_test.ts | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/cli/tests/unit/globals_test.ts b/cli/tests/unit/globals_test.ts index cf7293bba..c63b28973 100644 --- a/cli/tests/unit/globals_test.ts +++ b/cli/tests/unit/globals_test.ts @@ -71,12 +71,8 @@ Deno.test(function webAssemblyExists() { assert(typeof WebAssembly.compile === "function"); }); -declare global { - namespace Deno { - // deno-lint-ignore no-explicit-any, no-var - var core: any; - } -} +// @ts-ignore This is not publicly typed namespace, but it's there for sure. +const core = Deno[Deno.internal].core; Deno.test(function DenoNamespaceConfigurable() { const desc = Object.getOwnPropertyDescriptor(globalThis, "Deno"); @@ -86,19 +82,19 @@ Deno.test(function DenoNamespaceConfigurable() { }); Deno.test(function DenoCoreNamespaceIsImmutable() { - const { print } = Deno.core; + const { print } = core; try { - Deno.core.print = 1; + core.print = 1; } catch { // pass } - assert(print === Deno.core.print); + assert(print === core.print); try { - delete Deno.core.print; + delete core.print; } catch { // pass } - assert(print === Deno.core.print); + assert(print === core.print); }); Deno.test(async function windowQueueMicrotask() { |