diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-03-29 04:03:49 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 13:03:49 -0400 |
commit | bced52505f32d6cca4f944bb610a8a26767908a8 (patch) | |
tree | da49a5df4b7bd6f8306248069228cd6bd0db1303 /cli/js/tests/console_test.ts | |
parent | 1397b8e0e7c85762e19d88fde103342bfa563360 (diff) |
Update to Prettier 2 and use ES Private Fields (#4498)
Diffstat (limited to 'cli/js/tests/console_test.ts')
-rw-r--r-- | cli/js/tests/console_test.ts | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/cli/js/tests/console_test.ts b/cli/js/tests/console_test.ts index e571b02fb..b4848332f 100644 --- a/cli/js/tests/console_test.ts +++ b/cli/js/tests/console_test.ts @@ -6,14 +6,14 @@ import { assert, assertEquals, unitTest } from "./test_util.ts"; const { inspect, writeSync, - stdout + stdout, // eslint-disable-next-line @typescript-eslint/no-explicit-any } = Deno as any; const customInspect = Deno.symbols.customInspect; const { Console, - stringifyArgs + stringifyArgs, // @ts-ignore TypeScript (as of 3.7) does not support indexing namespaces by symbol } = Deno[Deno.symbols.internal]; @@ -37,7 +37,7 @@ unitTest(function consoleHasRightInstance(): void { }); unitTest(function consoleTestAssertShouldNotThrowError(): void { - mockConsole(console => { + mockConsole((console) => { console.assert(true); let hasThrown = undefined; try { @@ -92,7 +92,7 @@ unitTest(function consoleTestStringifyCircular(): void { arrowFunc: () => {}, extendedClass: new Extended(), nFunc: new Function(), - extendedCstr: Extended + extendedCstr: Extended, }; const circularObj = { @@ -105,7 +105,7 @@ unitTest(function consoleTestStringifyCircular(): void { nested: nestedObj, emptyObj: {}, arr: [1, "s", false, null, nestedObj], - baseClass: new Base() + baseClass: new Base(), }; nestedObj.o = circularObj; @@ -154,7 +154,7 @@ unitTest(function consoleTestStringifyCircular(): void { stringify( new Map([ [1, "one"], - [2, "two"] + [2, "two"], ]) ), `Map { 1 => "one", 2 => "two" }` @@ -192,7 +192,6 @@ unitTest(function consoleTestStringifyCircular(): void { assertEquals( stringify(console), `{ - printFunc: [Function], log: [Function], debug: [Function], info: [Function], @@ -261,8 +260,8 @@ unitTest(function consoleTestStringifyLargeObject(): void { g: 10, asd: 2, asda: 3, - x: { a: "asd", x: 3 } - } + x: { a: "asd", x: 3 }, + }, }; assertEquals( stringify(obj), @@ -394,14 +393,14 @@ unitTest(function consoleTestWithVariousOrInvalidFormatSpecifier(): void { unitTest(function consoleTestCallToStringOnLabel(): void { const methods = ["count", "countReset", "time", "timeLog", "timeEnd"]; - mockConsole(console => { + mockConsole((console) => { for (const method of methods) { let hasCalled = false; // @ts-ignore console[method]({ toString(): void { hasCalled = true; - } + }, }); assertEquals(hasCalled, true); } @@ -446,7 +445,7 @@ unitTest(function consoleTestClear(): void { // Test bound this issue unitTest(function consoleDetachedLog(): void { - mockConsole(console => { + mockConsole((console) => { const log = console.log; const dir = console.dir; const dirxml = console.dirxml; @@ -635,7 +634,7 @@ unitTest(function consoleTable(): void { console.table( new Map([ [1, "one"], - [2, "two"] + [2, "two"], ]) ); assertEquals( @@ -655,7 +654,7 @@ unitTest(function consoleTable(): void { b: { c: { d: 10 }, e: [1, 2, [5, 6]] }, f: "test", g: new Set([1, 2, 3, "test"]), - h: new Map([[1, "one"]]) + h: new Map([[1, "one"]]), }); assertEquals( out.toString(), @@ -677,7 +676,7 @@ unitTest(function consoleTable(): void { "test", false, { a: 10 }, - ["test", { b: 20, c: "test" }] + ["test", { b: 20, c: "test" }], ]); assertEquals( out.toString(), @@ -745,7 +744,7 @@ unitTest(function consoleTable(): void { // console.log(Error) test unitTest(function consoleLogShouldNotThrowError(): void { - mockConsole(console => { + mockConsole((console) => { let result = 0; try { console.log(new Error("foo")); |