mirror of
https://github.com/denoland/deno.git
synced 2025-07-08 05:45:07 +00:00
32 lines
754 B
TypeScript
32 lines
754 B
TypeScript
// Copyright 2018-2025 the Deno authors. 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,
|
|
);
|
|
});
|
|
|
|
Deno.test("[node/assert] deepStrictEqual(0, -0)", () => {
|
|
assert.throws(
|
|
() => {
|
|
assert.deepStrictEqual(0, -0);
|
|
},
|
|
);
|
|
});
|
|
|
|
Deno.test("[node/assert] CallTracker correctly exported", () => {
|
|
assert.strictEqual(typeof assert.CallTracker, "function");
|
|
assert.strictEqual(typeof assert.default.CallTracker, "function");
|
|
assert.strictEqual(assert.CallTracker, assert.default.CallTracker);
|
|
});
|