diff options
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 { |