From aa657d6493cb0f36a5e2aa29e6352c9a9991ad2b Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 16 Sep 2020 18:42:51 +0800 Subject: fix(std/testing): assertion diff color (#7499) --- std/testing/asserts.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'std/testing/asserts.ts') diff --git a/std/testing/asserts.ts b/std/testing/asserts.ts index b7377c1bc..a3f0c1338 100644 --- a/std/testing/asserts.ts +++ b/std/testing/asserts.ts @@ -21,13 +21,13 @@ export class AssertionError extends Error { export function _format(v: unknown): string { let string = globalThis.Deno - ? Deno.inspect(v, { + ? stripColor(Deno.inspect(v, { depth: Infinity, sorted: true, trailingComma: true, compact: false, iterableLimit: Infinity, - }) + })) : String(v); if (typeof v == "string") { string = `"${string.replace(/(?=["\\])/g, "\\")}"`; @@ -303,7 +303,7 @@ export function assertStrictEquals( } /** - * Make an assertion that `actual` and `expected` are not strictly equal. + * Make an assertion that `actual` and `expected` are not strictly equal. * If the values are strictly equal then throw. * ```ts * assertNotStrictEquals(1, 1) -- cgit v1.2.3