diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-06-03 04:38:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-02 23:38:46 -0400 |
commit | aaa2ed5a6450572d90fdb3fc2f0000759599d46f (patch) | |
tree | 06f5e07e8042156655d42996d5e7e677f62eefe3 /std/testing/asserts_test.ts | |
parent | 1db98f10b804129d965daa18de6d528e592a3c0f (diff) |
fix(std/testing/asserts): Format values in assertArrayContains() (#6060)
Diffstat (limited to 'std/testing/asserts_test.ts')
-rw-r--r-- | std/testing/asserts_test.ts | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/std/testing/asserts_test.ts b/std/testing/asserts_test.ts index fb25d46cf..c333d41da 100644 --- a/std/testing/asserts_test.ts +++ b/std/testing/asserts_test.ts @@ -151,15 +151,11 @@ test("testingArrayContains", function (): void { const fixtureObject = [{ deno: "luv" }, { deno: "Js" }]; assertArrayContains(fixture, ["deno"]); assertArrayContains(fixtureObject, [{ deno: "luv" }]); - let didThrow; - try { - assertArrayContains(fixtureObject, [{ deno: "node" }]); - didThrow = false; - } catch (e) { - assert(e instanceof AssertionError); - didThrow = true; - } - assertEquals(didThrow, true); + assertThrows( + (): void => assertArrayContains(fixtureObject, [{ deno: "node" }]), + AssertionError, + `actual: "[ { deno: "luv" }, { deno: "Js" } ]" expected to contain: "[ { deno: "node" } ]"\nmissing: [ { deno: "node" } ]` + ); }); test("testingAssertStringContainsThrow", function (): void { |