summaryrefslogtreecommitdiff
path: root/tests/unit_node/assert_test.ts
blob: dc565458f6306880dd13bb9e305c84eb2d171161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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,
  );
});