diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-03-08 12:27:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-08 13:27:49 +0100 |
commit | 0bc488c85c4bbc5b900cf5ff7b09227345b87763 (patch) | |
tree | 315a6bded05a4ab5d9946f837e4ec98162420089 /cli/tests | |
parent | ceeebe46eeb548ab3048f244a942973d9e8a2f41 (diff) |
fix(runtime/js): add navigator interface objects (#9685)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/globals_test.ts | 6 | ||||
-rw-r--r-- | cli/tests/workers/test.ts | 2 | ||||
-rw-r--r-- | cli/tests/workers/worker_globals.ts | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/cli/tests/unit/globals_test.ts b/cli/tests/unit/globals_test.ts index dbb9bd90a..ce43fddf1 100644 --- a/cli/tests/unit/globals_test.ts +++ b/cli/tests/unit/globals_test.ts @@ -48,6 +48,12 @@ unitTest(function globalThisInstanceofEventTarget(): void { assert(globalThis instanceof EventTarget); }); +unitTest(function navigatorInstanceofNavigator(): void { + // TODO(nayeemrmn): Add `Navigator` to deno_lint globals. + // deno-lint-ignore no-undef + assert(navigator instanceof Navigator); +}); + unitTest(function DenoNamespaceExists(): void { assert(Deno != null); }); diff --git a/cli/tests/workers/test.ts b/cli/tests/workers/test.ts index c2dd41aee..e5e9e44f7 100644 --- a/cli/tests/workers/test.ts +++ b/cli/tests/workers/test.ts @@ -118,7 +118,7 @@ Deno.test({ workerOptions, ); w.onmessage = (e): void => { - assertEquals(e.data, "true, true, true"); + assertEquals(e.data, "true, true, true, true"); promise.resolve(); }; w.postMessage("Hello, world!"); diff --git a/cli/tests/workers/worker_globals.ts b/cli/tests/workers/worker_globals.ts index a9e7efd85..f26242306 100644 --- a/cli/tests/workers/worker_globals.ts +++ b/cli/tests/workers/worker_globals.ts @@ -4,6 +4,9 @@ onmessage = function (): void { self instanceof DedicatedWorkerGlobalScope, self instanceof WorkerGlobalScope, self instanceof EventTarget, + // TODO(nayeemrmn): Add `WorkerNavigator` to deno_lint globals. + // deno-lint-ignore no-undef + navigator instanceof WorkerNavigator, ].join(", "), ); close(); |