diff options
Diffstat (limited to 'tests/unit_node/assert_test.ts')
-rw-r--r-- | tests/unit_node/assert_test.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit_node/assert_test.ts b/tests/unit_node/assert_test.ts new file mode 100644 index 000000000..dc565458f --- /dev/null +++ b/tests/unit_node/assert_test.ts @@ -0,0 +1,18 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +import * as assert from "node:assert"; + +Deno.test("[node/assert] .throws() compares Error instance", () => { + assert.throws( + () => { + throw new Error("FAIL"); + }, + Error, + ); + + assert.throws( + () => { + throw new TypeError("FAIL"); + }, + TypeError, + ); +}); |