summaryrefslogtreecommitdiff
path: root/cli/tests/unit/globals_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/globals_test.ts')
-rw-r--r--cli/tests/unit/globals_test.ts30
1 files changed, 23 insertions, 7 deletions
diff --git a/cli/tests/unit/globals_test.ts b/cli/tests/unit/globals_test.ts
index ccea6e74c..116df1698 100644
--- a/cli/tests/unit/globals_test.ts
+++ b/cli/tests/unit/globals_test.ts
@@ -47,7 +47,9 @@ unitTest(function webAssemblyExists(): void {
/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/no-explicit-any,no-var */
declare global {
+ // deno-lint-ignore no-namespace
namespace Deno {
+ // deno-lint-ignore no-explicit-any
var core: any;
}
}
@@ -58,37 +60,51 @@ unitTest(function DenoNamespaceImmutable(): void {
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(Deno as any) = 1;
- } catch {}
+ } catch {
+ // pass
+ }
assert(denoCopy === Deno);
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(window as any).Deno = 1;
- } catch {}
+ } catch {
+ // pass
+ }
assert(denoCopy === Deno);
try {
delete window.Deno;
- } catch {}
+ } catch {
+ // pass
+ }
assert(denoCopy === Deno);
const { readFile } = Deno;
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(Deno as any).readFile = 1;
- } catch {}
+ } catch {
+ // pass
+ }
assert(readFile === Deno.readFile);
try {
delete window.Deno.readFile;
- } catch {}
+ } catch {
+ // pass
+ }
assert(readFile === Deno.readFile);
const { print } = Deno.core;
try {
Deno.core.print = 1;
- } catch {}
+ } catch {
+ // pass
+ }
assert(print === Deno.core.print);
try {
delete Deno.core.print;
- } catch {}
+ } catch {
+ // pass
+ }
assert(print === Deno.core.print);
});