mirror of
https://github.com/denoland/std.git
synced 2024-11-21 12:40:03 +00:00
5803cc9172
* BREAKING(assert): remove `assert` from module names * work * fix * work * work * tweaks * fix
33 lines
920 B
TypeScript
33 lines
920 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
import { AssertionError, assertNotEquals, assertThrows } from "./mod.ts";
|
|
|
|
Deno.test("assertNotEquals()", () => {
|
|
assertNotEquals<unknown>({ foo: "bar" }, { bar: "foo" });
|
|
assertNotEquals("Denosaurus", "Tyrannosaurus");
|
|
assertNotEquals(
|
|
new Date(2019, 0, 3, 4, 20, 1, 10),
|
|
new Date(2019, 0, 3, 4, 20, 1, 20),
|
|
);
|
|
assertNotEquals(new Date("invalid"), new Date(2019, 0, 3, 4, 20, 1, 20));
|
|
});
|
|
|
|
Deno.test("assertNotEquals() throws", () => {
|
|
assertThrows(
|
|
() => {
|
|
assertNotEquals("foo", "foo");
|
|
},
|
|
AssertionError,
|
|
"Expected actual: foo not to be: foo.",
|
|
);
|
|
});
|
|
|
|
Deno.test("assertNotEquals() throws with custom message", () => {
|
|
assertThrows(
|
|
() => {
|
|
assertNotEquals("foo", "foo", "CUSTOM MESSAGE");
|
|
},
|
|
AssertionError,
|
|
"Expected actual: foo not to be: foo: CUSTOM MESSAGE",
|
|
);
|
|
});
|