mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 23:34:47 -05:00
19 lines
363 B
TypeScript
19 lines
363 B
TypeScript
|
// 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,
|
||
|
);
|
||
|
});
|