diff options
| author | Ryan Dahl <ry@tinyclouds.org> | 2019-03-06 19:42:24 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-06 19:42:24 -0500 |
| commit | caa383a5835c167bf6657120ad3c1c5009670785 (patch) | |
| tree | 2f350928e23e472278b9c3ebd798f13169b6d581 /testing | |
| parent | e36edfdb3fd4709358a5f499f13cfe3d53c2b4f7 (diff) | |
Rename assertEq to assertEquals (denoland/deno_std#242)
After some discussion it was found that assertEquals is more common
in JS (vs assertEqual, assertEq) and sounds better in the negated form:
assertNotEquals vs assertNE.
Original: https://github.com/denoland/deno_std/commit/4cf39d4a1420b8153cd78d03d03ef843607ae506
Diffstat (limited to 'testing')
| -rw-r--r-- | testing/README.md | 12 | ||||
| -rw-r--r-- | testing/asserts.ts | 4 | ||||
| -rw-r--r-- | testing/asserts_test.ts | 2 | ||||
| -rw-r--r-- | testing/diff_test.ts | 22 | ||||
| -rw-r--r-- | testing/format_test.ts | 140 | ||||
| -rw-r--r-- | testing/pretty.ts | 2 | ||||
| -rw-r--r-- | testing/pretty_test.ts | 20 | ||||
| -rw-r--r-- | testing/test.ts | 4 |
8 files changed, 103 insertions, 103 deletions
diff --git a/testing/README.md b/testing/README.md index 4c295e472..c134dd912 100644 --- a/testing/README.md +++ b/testing/README.md @@ -16,7 +16,7 @@ Asserts are exposed in `testing/asserts.ts` module. - `equal` - Deep comparision function, where `actual` and `expected` are compared deeply, and if they vary, `equal` returns `false`. - `assert()` - Expects a boolean value, throws if the value is `false`. -- `assertEq()` - Uses the `equal` comparison and throws if the `actual` and +- `assertEquals()` - Uses the `equal` comparison and throws if the `actual` and `expected` are not equal. - `assertStrictEq()` - Compares `actual` and `expected` strictly, therefore for non-primitives the values must reference the same instance. @@ -36,13 +36,13 @@ Basic usage: ```ts import { runTests, test } from "https://deno.land/std/testing/mod.ts"; -import { assertEq } from "https://deno.land/std/testing/asserts.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; test({ name: "testing example", fn() { - assertEq("world", "world")); - assertEq({ hello: "world" }, { hello: "world" })); + assertEquals("world", "world")); + assertEquals({ hello: "world" }, { hello: "world" })); } }); @@ -53,8 +53,8 @@ Short syntax (named function instead of object): ```ts test(function example() { - assertEq("world", "world")); - assertEq({ hello: "world" }, { hello: "world" })); + assertEquals("world", "world")); + assertEquals({ hello: "world" }, { hello: "world" })); }); ``` diff --git a/testing/asserts.ts b/testing/asserts.ts index 8932793d4..883632b1e 100644 --- a/testing/asserts.ts +++ b/testing/asserts.ts @@ -1,5 +1,5 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { assertEq as prettyAssertEqual } from "./pretty.ts"; +import { assertEquals as prettyAssertEqual } from "./pretty.ts"; interface Constructor { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -44,7 +44,7 @@ export function assert(expr: boolean, msg = ""): void { * Make an assertion that `actual` and `expected` are equal, deeply. If not * deeply equal, then throw. */ -export function assertEq( +export function assertEquals( actual: unknown, expected: unknown, msg?: string diff --git a/testing/asserts_test.ts b/testing/asserts_test.ts index 9dc70ad29..fb26d9cd2 100644 --- a/testing/asserts_test.ts +++ b/testing/asserts_test.ts @@ -2,7 +2,7 @@ import { assert, equal, assertStrContains, assertMatch } from "./asserts.ts"; import { test } from "./mod.ts"; -// import { assertEq as prettyAssertEqual } from "./pretty.ts"; +// import { assertEquals as prettyAssertEqual } from "./pretty.ts"; // import "./format_test.ts"; // import "./diff_test.ts"; // import "./pretty_test.ts"; diff --git a/testing/diff_test.ts b/testing/diff_test.ts index cd71b25d8..e62f45248 100644 --- a/testing/diff_test.ts +++ b/testing/diff_test.ts @@ -1,18 +1,18 @@ import diff from "./diff.ts"; -import { assertEq } from "../testing/asserts.ts"; +import { assertEquals } from "../testing/asserts.ts"; import { test } from "./mod.ts"; test({ name: "empty", fn() { - assertEq(diff([], []), []); + assertEquals(diff([], []), []); } }); test({ name: '"a" vs "b"', fn() { - assertEq(diff(["a"], ["b"]), [ + assertEquals(diff(["a"], ["b"]), [ { type: "removed", value: "a" }, { type: "added", value: "b" } ]); @@ -22,28 +22,28 @@ test({ test({ name: '"a" vs "a"', fn() { - assertEq(diff(["a"], ["a"]), [{ type: "common", value: "a" }]); + assertEquals(diff(["a"], ["a"]), [{ type: "common", value: "a" }]); } }); test({ name: '"a" vs ""', fn() { - assertEq(diff(["a"], []), [{ type: "removed", value: "a" }]); + assertEquals(diff(["a"], []), [{ type: "removed", value: "a" }]); } }); test({ name: '"" vs "a"', fn() { - assertEq(diff([], ["a"]), [{ type: "added", value: "a" }]); + assertEquals(diff([], ["a"]), [{ type: "added", value: "a" }]); } }); test({ name: '"a" vs "a, b"', fn() { - assertEq(diff(["a"], ["a", "b"]), [ + assertEquals(diff(["a"], ["a", "b"]), [ { type: "common", value: "a" }, { type: "added", value: "b" } ]); @@ -53,7 +53,7 @@ test({ test({ name: '"strength" vs "string"', fn() { - assertEq(diff(Array.from("strength"), Array.from("string")), [ + assertEquals(diff(Array.from("strength"), Array.from("string")), [ { type: "common", value: "s" }, { type: "common", value: "t" }, { type: "common", value: "r" }, @@ -70,7 +70,7 @@ test({ test({ name: '"strength" vs ""', fn() { - assertEq(diff(Array.from("strength"), Array.from("")), [ + assertEquals(diff(Array.from("strength"), Array.from("")), [ { type: "removed", value: "s" }, { type: "removed", value: "t" }, { type: "removed", value: "r" }, @@ -86,7 +86,7 @@ test({ test({ name: '"" vs "strength"', fn() { - assertEq(diff(Array.from(""), Array.from("strength")), [ + assertEquals(diff(Array.from(""), Array.from("strength")), [ { type: "added", value: "s" }, { type: "added", value: "t" }, { type: "added", value: "r" }, @@ -102,7 +102,7 @@ test({ test({ name: '"abc", "c" vs "abc", "bcd", "c"', fn() { - assertEq(diff(["abc", "c"], ["abc", "bcd", "c"]), [ + assertEquals(diff(["abc", "c"], ["abc", "bcd", "c"]), [ { type: "common", value: "abc" }, { type: "added", value: "bcd" }, { type: "common", value: "c" } diff --git a/testing/format_test.ts b/testing/format_test.ts index 23c5ca1c0..fe6d946ef 100644 --- a/testing/format_test.ts +++ b/testing/format_test.ts @@ -7,7 +7,7 @@ * */ import { test } from "./mod.ts"; -import { assertEq } from "../testing/asserts.ts"; +import { assertEquals } from "../testing/asserts.ts"; import { format } from "./format.ts"; // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-explicit-any @@ -55,7 +55,7 @@ test({ name: "prints empty arguments", fn() { const val = returnArguments(); - assertEq(format(val), "Arguments []"); + assertEquals(format(val), "Arguments []"); } }); @@ -63,7 +63,7 @@ test({ name: "prints an empty array", fn() { const val: unknown[] = []; - assertEq(format(val), "Array []"); + assertEquals(format(val), "Array []"); } }); @@ -71,7 +71,7 @@ test({ name: "prints an array with items", fn() { const val = [1, 2, 3]; - assertEq(format(val), "Array [\n 1,\n 2,\n 3,\n]"); + assertEquals(format(val), "Array [\n 1,\n 2,\n 3,\n]"); } }); @@ -79,7 +79,7 @@ test({ name: "prints a empty typed array", fn() { const val = new Uint32Array(0); - assertEq(format(val), "Uint32Array []"); + assertEquals(format(val), "Uint32Array []"); } }); @@ -87,7 +87,7 @@ test({ name: "prints a typed array with items", fn() { const val = new Uint32Array(3); - assertEq(format(val), "Uint32Array [\n 0,\n 0,\n 0,\n]"); + assertEquals(format(val), "Uint32Array [\n 0,\n 0,\n 0,\n]"); } }); @@ -95,7 +95,7 @@ test({ name: "prints an array buffer", fn() { const val = new ArrayBuffer(3); - assertEq(format(val), "ArrayBuffer []"); + assertEquals(format(val), "ArrayBuffer []"); } }); @@ -103,7 +103,7 @@ test({ name: "prints a nested array", fn() { const val = [[1, 2, 3]]; - assertEq( + assertEquals( format(val), "Array [\n Array [\n 1,\n 2,\n 3,\n ],\n]" ); @@ -114,7 +114,7 @@ test({ name: "prints true", fn() { const val = true; - assertEq(format(val), "true"); + assertEquals(format(val), "true"); } }); @@ -122,7 +122,7 @@ test({ name: "prints false", fn() { const val = false; - assertEq(format(val), "false"); + assertEquals(format(val), "false"); } }); @@ -130,7 +130,7 @@ test({ name: "prints an error", fn() { const val = new Error(); - assertEq(format(val), "[Error]"); + assertEquals(format(val), "[Error]"); } }); @@ -138,7 +138,7 @@ test({ name: "prints a typed error with a message", fn() { const val = new TypeError("message"); - assertEq(format(val), "[TypeError: message]"); + assertEquals(format(val), "[TypeError: message]"); } }); @@ -147,7 +147,7 @@ test({ fn() { // tslint:disable-next-line:function-constructor const val = new Function(); - assertEq(format(val), "[Function anonymous]"); + assertEquals(format(val), "[Function anonymous]"); } }); @@ -160,7 +160,7 @@ test({ } // tslint:disable-next-line:no-empty f(() => {}); - assertEq(format(val), "[Function anonymous]"); + assertEquals(format(val), "[Function anonymous]"); } }); @@ -170,7 +170,7 @@ test({ // tslint:disable-next-line:no-empty const val = (): void => {}; const formatted = format(val); - assertEq( + assertEquals( formatted === "[Function anonymous]" || formatted === "[Function val]", true ); @@ -182,7 +182,7 @@ test({ fn() { // tslint:disable-next-line:no-empty const val = function named(): void {}; - assertEq(format(val), "[Function named]"); + assertEquals(format(val), "[Function named]"); } }); @@ -194,7 +194,7 @@ test({ yield 2; yield 3; }; - assertEq(format(val), "[Function generate]"); + assertEquals(format(val), "[Function generate]"); } }); @@ -203,7 +203,7 @@ test({ fn() { // tslint:disable-next-line:no-empty const val = function named(): void {}; - assertEq( + assertEquals( format(val, { printFunctionName: false }), @@ -216,7 +216,7 @@ test({ name: "prints Infinity", fn() { const val = Infinity; - assertEq(format(val), "Infinity"); + assertEquals(format(val), "Infinity"); } }); @@ -224,7 +224,7 @@ test({ name: "prints -Infinity", fn() { const val = -Infinity; - assertEq(format(val), "-Infinity"); + assertEquals(format(val), "-Infinity"); } }); @@ -232,7 +232,7 @@ test({ name: "prints an empty map", fn() { const val = new Map(); - assertEq(format(val), "Map {}"); + assertEquals(format(val), "Map {}"); } }); @@ -242,7 +242,7 @@ test({ const val = new Map(); val.set("prop1", "value1"); val.set("prop2", "value2"); - assertEq( + assertEquals( format(val), 'Map {\n "prop1" => "value1",\n "prop2" => "value2",\n}' ); @@ -288,7 +288,7 @@ test({ ' } => "object",', "}" ].join("\n"); - assertEq(format(val), expected); + assertEquals(format(val), expected); } }); @@ -296,7 +296,7 @@ test({ name: "prints NaN", fn() { const val = NaN; - assertEq(format(val), "NaN"); + assertEquals(format(val), "NaN"); } }); @@ -304,7 +304,7 @@ test({ name: "prints null", fn() { const val = null; - assertEq(format(val), "null"); + assertEquals(format(val), "null"); } }); @@ -312,7 +312,7 @@ test({ name: "prints a positive number", fn() { const val = 123; - assertEq(format(val), "123"); + assertEquals(format(val), "123"); } }); @@ -320,7 +320,7 @@ test({ name: "prints a negative number", fn() { const val = -123; - assertEq(format(val), "-123"); + assertEquals(format(val), "-123"); } }); @@ -328,7 +328,7 @@ test({ name: "prints zero", fn() { const val = 0; - assertEq(format(val), "0"); + assertEquals(format(val), "0"); } }); @@ -336,7 +336,7 @@ test({ name: "prints negative zero", fn() { const val = -0; - assertEq(format(val), "-0"); + assertEquals(format(val), "-0"); } }); @@ -344,7 +344,7 @@ test({ name: "prints a date", fn() { const val = new Date(10e11); - assertEq(format(val), "2001-09-09T01:46:40.000Z"); + assertEquals(format(val), "2001-09-09T01:46:40.000Z"); } }); @@ -352,7 +352,7 @@ test({ name: "prints an invalid date", fn() { const val = new Date(Infinity); - assertEq(format(val), "Date { NaN }"); + assertEquals(format(val), "Date { NaN }"); } }); @@ -360,7 +360,7 @@ test({ name: "prints an empty object", fn() { const val = {}; - assertEq(format(val), "Object {}"); + assertEquals(format(val), "Object {}"); } }); @@ -368,7 +368,7 @@ test({ name: "prints an object with properties", fn() { const val = { prop1: "value1", prop2: "value2" }; - assertEq( + assertEquals( format(val), 'Object {\n "prop1": "value1",\n "prop2": "value2",\n}' ); @@ -383,7 +383,7 @@ test({ val[Symbol("symbol1")] = "value2"; val[Symbol("symbol2")] = "value3"; val.prop = "value1"; - assertEq( + assertEquals( format(val), 'Object {\n "prop": "value1",\n Symbol(symbol1): "value2",\n Symbol(symbol2): "value3",\n}' ); @@ -402,7 +402,7 @@ test({ enumerable: false, value: false }); - assertEq(format(val), 'Object {\n "enumerable": true,\n}'); + assertEquals(format(val), 'Object {\n "enumerable": true,\n}'); } }); @@ -418,7 +418,7 @@ test({ enumerable: false, value: false }); - assertEq(format(val), 'Object {\n "enumerable": true,\n}'); + assertEquals(format(val), 'Object {\n "enumerable": true,\n}'); } }); @@ -426,7 +426,7 @@ test({ name: "prints an object with sorted properties", fn() { const val = { b: 1, a: 2 }; - assertEq(format(val), 'Object {\n "a": 2,\n "b": 1,\n}'); + assertEquals(format(val), 'Object {\n "a": 2,\n "b": 1,\n}'); } }); @@ -434,7 +434,7 @@ test({ name: "prints regular expressions from constructors", fn() { const val = new RegExp("regexp"); - assertEq(format(val), "/regexp/"); + assertEquals(format(val), "/regexp/"); } }); @@ -442,7 +442,7 @@ test({ name: "prints regular expressions from literals", fn() { const val = /regexp/gi; - assertEq(format(val), "/regexp/gi"); + assertEquals(format(val), "/regexp/gi"); } }); @@ -450,7 +450,7 @@ test({ name: "prints regular expressions {escapeRegex: false}", fn() { const val = /regexp\d/gi; - assertEq(format(val), "/regexp\\d/gi"); + assertEquals(format(val), "/regexp\\d/gi"); } }); @@ -458,7 +458,7 @@ test({ name: "prints regular expressions {escapeRegex: true}", fn() { const val = /regexp\d/gi; - assertEq(format(val, { escapeRegex: true }), "/regexp\\\\d/gi"); + assertEquals(format(val, { escapeRegex: true }), "/regexp\\\\d/gi"); } }); @@ -466,7 +466,7 @@ test({ name: "escapes regular expressions nested inside object", fn() { const obj = { test: /regexp\d/gi }; - assertEq( + assertEquals( format(obj, { escapeRegex: true }), 'Object {\n "test": /regexp\\\\d/gi,\n}' ); @@ -477,7 +477,7 @@ test({ name: "prints an empty set", fn() { const val = new Set(); - assertEq(format(val), "Set {}"); + assertEquals(format(val), "Set {}"); } }); @@ -487,7 +487,7 @@ test({ const val = new Set(); val.add("value1"); val.add("value2"); - assertEq(format(val), 'Set {\n "value1",\n "value2",\n}'); + assertEquals(format(val), 'Set {\n "value1",\n "value2",\n}'); } }); @@ -495,7 +495,7 @@ test({ name: "prints a string", fn() { const val = "string"; - assertEq(format(val), '"string"'); + assertEquals(format(val), '"string"'); } }); @@ -503,7 +503,7 @@ test({ name: "prints and escape a string", fn() { const val = "\"'\\"; - assertEq(format(val), '"\\"\'\\\\"'); + assertEquals(format(val), '"\\"\'\\\\"'); } }); @@ -511,15 +511,15 @@ test({ name: "doesn't escape string with {excapeString: false}", fn() { const val = "\"'\\n"; - assertEq(format(val, { escapeString: false }), '""\'\\n"'); + assertEquals(format(val, { escapeString: false }), '""\'\\n"'); } }); test({ name: "prints a string with escapes", fn() { - assertEq(format('"-"'), '"\\"-\\""'); - assertEq(format("\\ \\\\"), '"\\\\ \\\\\\\\"'); + assertEquals(format('"-"'), '"\\"-\\""'); + assertEquals(format("\\ \\\\"), '"\\\\ \\\\\\\\"'); } }); @@ -527,7 +527,7 @@ test({ name: "prints a multiline string", fn() { const val = ["line 1", "line 2", "line 3"].join("\n"); - assertEq(format(val), '"' + val + '"'); + assertEquals(format(val), '"' + val + '"'); } }); @@ -547,7 +547,7 @@ test({ }, type: "svg" }; - assertEq( + assertEquals( format(val), [ "Object {", @@ -573,7 +573,7 @@ test({ name: "prints a symbol", fn() { const val = Symbol("symbol"); - assertEq(format(val), "Symbol(symbol)"); + assertEquals(format(val), "Symbol(symbol)"); } }); @@ -581,7 +581,7 @@ test({ name: "prints undefined", fn() { const val = undefined; - assertEq(format(val), "undefined"); + assertEquals(format(val), "undefined"); } }); @@ -589,7 +589,7 @@ test({ name: "prints a WeakMap", fn() { const val = new WeakMap(); - assertEq(format(val), "WeakMap {}"); + assertEquals(format(val), "WeakMap {}"); } }); @@ -597,7 +597,7 @@ test({ name: "prints a WeakSet", fn() { const val = new WeakSet(); - assertEq(format(val), "WeakSet {}"); + assertEquals(format(val), "WeakSet {}"); } }); @@ -605,7 +605,7 @@ test({ name: "prints deeply nested objects", fn() { const val = { prop: { prop: { prop: "value" } } }; - assertEq( + assertEquals( format(val), 'Object {\n "prop": Object {\n "prop": Object {\n "prop": "value",\n },\n },\n}' ); @@ -618,7 +618,7 @@ test({ // eslint-disable-next-line @typescript-eslint/no-explicit-any const val: any = {}; val.prop = val; - assertEq(format(val), 'Object {\n "prop": [Circular],\n}'); + assertEquals(format(val), 'Object {\n "prop": [Circular],\n}'); } }); @@ -627,7 +627,7 @@ test({ fn() { const inner = {}; const val = { prop1: inner, prop2: inner }; - assertEq( + assertEquals( format(val), 'Object {\n "prop1": Object {},\n "prop2": Object {},\n}' ); @@ -637,14 +637,14 @@ test({ test({ name: "default implicit: 2 spaces", fn() { - assertEq(format(createVal()), createExpected()); + assertEquals(format(createVal()), createExpected()); } }); test({ name: "default explicit: 2 spaces", fn() { - assertEq(format(createVal(), { indent: 2 }), createExpected()); + assertEquals(format(createVal(), { indent: 2 }), createExpected()); } }); @@ -653,7 +653,7 @@ test({ name: "non-default: 0 spaces", fn() { const indent = 0; - assertEq( + assertEquals( format(createVal(), { indent }), createExpected().replace(/ {2}/g, " ".repeat(indent)) ); @@ -664,7 +664,7 @@ test({ name: "non-default: 4 spaces", fn() { const indent = 4; - assertEq( + assertEquals( format(createVal(), { indent }), createExpected().replace(/ {2}/g, " ".repeat(indent)) ); @@ -692,7 +692,7 @@ test({ "set non-empty": new Set(["value"]) } ]; - assertEq( + assertEquals( format(v, { maxDepth: 2 }), [ "Array [", @@ -720,7 +720,7 @@ test({ test({ name: "prints objects with no constructor", fn() { - assertEq(format(Object.create(null)), "Object {}"); + assertEquals(format(Object.create(null)), "Object {}"); } }); @@ -734,14 +734,14 @@ test({ ' "constructor": "constructor",', "}" ].join("\n"); - assertEq(format(obj), expected); + assertEquals(format(obj), expected); } }); test({ name: "calls toJSON and prints its return value", fn() { - assertEq( + assertEquals( format({ toJSON: () => ({ value: false }), value: true @@ -754,7 +754,7 @@ test({ test({ name: "calls toJSON and prints an internal representation.", fn() { - assertEq( + assertEquals( format({ toJSON: () => "[Internal Object]", value: true @@ -767,7 +767,7 @@ test({ test({ name: "calls toJSON only on functions", fn() { - assertEq( + assertEquals( format({ toJSON: false, value: true @@ -780,7 +780,7 @@ test({ test({ name: "does not call toJSON recursively", fn() { - assertEq( + assertEquals( format({ toJSON: () => ({ toJSON: () => ({ value: true }) }), value: false @@ -796,6 +796,6 @@ test({ const set = new Set([1]); // eslint-disable-next-line @typescript-eslint/no-explicit-any (set as any).toJSON = () => "map"; - assertEq(format(set), '"map"'); + assertEquals(format(set), '"map"'); } }); diff --git a/testing/pretty.ts b/testing/pretty.ts index fb2ae122e..f4794f889 100644 --- a/testing/pretty.ts +++ b/testing/pretty.ts @@ -55,7 +55,7 @@ function buildMessage(diffResult: ReadonlyArray<DiffResult<string>>): string[] { return messages; } -export function assertEq( +export function assertEquals( actual: unknown, expected: unknown, msg?: string diff --git a/testing/pretty_test.ts b/testing/pretty_test.ts index 0262bfcfd..d0e90f656 100644 --- a/testing/pretty_test.ts +++ b/testing/pretty_test.ts @@ -2,7 +2,7 @@ import { test } from "./mod.ts"; import { red, green, white, gray, bold } from "../colors/mod.ts"; -import { assertEq } from "./pretty.ts"; +import { assertEquals } from "./pretty.ts"; import { assertThrows } from "./asserts.ts"; const createHeader = (): string[] => [ @@ -19,11 +19,11 @@ const removed: (s: string) => string = (s: string): string => red(bold(s)); test({ name: "pass case", fn() { - assertEq({ a: 10 }, { a: 10 }); - assertEq(true, true); - assertEq(10, 10); - assertEq("abc", "abc"); - assertEq({ a: 10, b: { c: "1" } }, { a: 10, b: { c: "1" } }); + assertEquals({ a: 10 }, { a: 10 }); + assertEquals(true, true); + assertEquals(10, 10); + assertEquals("abc", "abc"); + assertEquals({ a: 10, b: { c: "1" } }, { a: 10, b: { c: "1" } }); } }); @@ -31,7 +31,7 @@ test({ name: "failed with number", fn() { assertThrows( - () => assertEq(1, 2), + () => assertEquals(1, 2), Error, [...createHeader(), removed(`- 1`), added(`+ 2`), ""].join("\n") ); @@ -42,7 +42,7 @@ test({ name: "failed with number vs string", fn() { assertThrows( - () => assertEq(1, "1"), + () => assertEquals(1, "1"), Error, [...createHeader(), removed(`- 1`), added(`+ "1"`)].join("\n") ); @@ -53,7 +53,7 @@ test({ name: "failed with array", fn() { assertThrows( - () => assertEq([1, "2", 3], ["1", "2", 3]), + () => assertEquals([1, "2", 3], ["1", "2", 3]), Error, [ ...createHeader(), @@ -73,7 +73,7 @@ test({ name: "failed with object", fn() { assertThrows( - () => assertEq({ a: 1, b: "2", c: 3 }, { a: 1, b: 2, c: [3] }), + () => assertEquals({ a: 1, b: "2", c: 3 }, { a: 1, b: 2, c: [3] }), Error, [ ...createHeader(), diff --git a/testing/test.ts b/testing/test.ts index e3fc5c431..7f904346c 100644 --- a/testing/test.ts +++ b/testing/test.ts @@ -2,7 +2,7 @@ import { test, runIfMain } from "./mod.ts"; import { assert, - assertEq, + assertEquals, assertStrictEq, assertThrows, assertThrowsAsync, @@ -28,7 +28,7 @@ test(function testingAssertEqualActualUncoercable() { let didThrow = false; const a = Object.create(null); try { - assertEq(a, "bar"); + assertEquals(a, "bar"); } catch (e) { didThrow = true; } |
