summaryrefslogtreecommitdiff
path: root/std/node/assert_test.ts
blob: 8df13187bbd5581c408c8d96e687135bf8fdf928 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import {
  assert as denoAssert,
  assertEquals,
  assertNotEquals,
  assertStrictEquals,
  assertNotStrictEquals,
  assertMatch,
  assertThrows,
  fail as denoFail,
} from "../testing/asserts.ts";

import assert from "./assert.ts";

import {
  ok,
  assert as assert_,
  deepStrictEqual,
  notDeepStrictEqual,
  strictEqual,
  notStrictEqual,
  match,
  throws,
  fail,
} from "./assert.ts";

Deno.test("API should be exposed", () => {
  assertStrictEquals(
    assert_,
    assert,
    "`assert()` should be the default export",
  );
  assertStrictEquals(assert_, denoAssert, "`assert()` should be exposed");
  assertStrictEquals(assert_, ok, "`assert()` should be an alias of `ok()`");
  assertStrictEquals(
    assertEquals,
    deepStrictEqual,
    "`assertEquals()` should be exposed as `deepStrictEqual()`",
  );
  assertStrictEquals(
    assertNotEquals,
    notDeepStrictEqual,
    "`assertNotEquals()` should be exposed as `notDeepStrictEqual()`",
  );
  assertStrictEquals(
    assertStrictEquals,
    strictEqual,
    "`assertStrictEquals()` should be exposed as `strictEqual()`",
  );
  assertStrictEquals(
    assertNotStrictEquals,
    notStrictEqual,
    "`assertNotStrictEquals()` should be exposed as `notStrictEqual()`",
  );
  assertStrictEquals(
    assertMatch,
    match,
    "`assertMatch()` should be exposed as `match()`",
  );
  assertStrictEquals(
    assertThrows,
    throws,
    "`assertThrows()` should be exposed as `throws()`",
  );
  assertStrictEquals(fail, denoFail, "`fail()` should be exposed");
});