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

assert_not_strict_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
30
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.import { AssertionError, assertNotStrictEquals, assertThrows } from "./mod.ts";
Deno.test({ name: "strictly unequal pass case", fn() { assertNotStrictEquals(true, false); assertNotStrictEquals(10, 11); assertNotStrictEquals("abc", "xyz"); assertNotStrictEquals<unknown>(1, "1"); assertNotStrictEquals(-0, +0);
const xs = [1, false, "foo"]; const ys = [1, true, "bar"]; assertNotStrictEquals(xs, ys);
const x = { a: 1 }; const y = { a: 2 }; assertNotStrictEquals(x, y); },});
Deno.test({ name: "strictly unequal fail case", fn() { assertThrows(() => assertNotStrictEquals(1, 1), AssertionError); assertThrows(() => assertNotStrictEquals(NaN, NaN), AssertionError); },});
std

Version Info

Tagged at
6 months ago