From ffedbd79ad90bc88ef8c51d145536f68f50d4fea Mon Sep 17 00:00:00 2001 From: Alan Gou Date: Fri, 19 Jun 2020 02:05:37 -0700 Subject: build: lint cli/tests/unit using deno lint (#6327) --- cli/tests/unit/globals_test.ts | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'cli/tests/unit/globals_test.ts') 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); }); -- cgit v1.2.3