summaryrefslogtreecommitdiff
path: root/cli/tests/unit/globals_test.ts
diff options
context:
space:
mode:
authorAlan Gou <alan@frontapp.com>2020-06-19 02:05:37 -0700
committerGitHub <noreply@github.com>2020-06-19 11:05:37 +0200
commitffedbd79ad90bc88ef8c51d145536f68f50d4fea (patch)
treec774772d18867fe08a87429446c473be2fc856c5 /cli/tests/unit/globals_test.ts
parent36ad5e44020a8bd48546e5a8bdb7db9c2f40dc52 (diff)
build: lint cli/tests/unit using deno lint (#6327)
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);
});