deno.land / std@0.224.0 / assert / assert_not_equals_test.ts

assert_not_equals_test.ts
View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.import { assert, assertEquals, AssertionError, assertNotEquals,} from "./mod.ts";
Deno.test("NotEquals", function () { const a = { foo: "bar" }; const b = { bar: "foo" }; assertNotEquals<unknown>(a, b); 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)); let didThrow; try { assertNotEquals("Raptor", "Raptor"); didThrow = false; } catch (e) { assert(e instanceof AssertionError); didThrow = true; } assertEquals(didThrow, true);});
std

Version Info

Tagged at
6 months ago