-
Notifications
You must be signed in to change notification settings - Fork 576
/
errors_test.ts
36 lines (32 loc) · 903 Bytes
/
errors_test.ts
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
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import {
NodeRangeError,
NodeSyntaxError,
NodeTypeError,
NodeURIError,
} from "./errors.ts";
import { assertEquals } from "../../testing/asserts.ts";
Deno.test("NodeSyntaxError string representation", () => {
assertEquals(
String(new NodeSyntaxError("CODE", "MESSAGE")),
"SyntaxError [CODE]: MESSAGE",
);
});
Deno.test("NodeRangeError string representation", () => {
assertEquals(
String(new NodeRangeError("CODE", "MESSAGE")),
"RangeError [CODE]: MESSAGE",
);
});
Deno.test("NodeTypeError string representation", () => {
assertEquals(
String(new NodeTypeError("CODE", "MESSAGE")),
"TypeError [CODE]: MESSAGE",
);
});
Deno.test("NodeURIError string representation", () => {
assertEquals(
String(new NodeURIError("CODE", "MESSAGE")),
"URIError [CODE]: MESSAGE",
);
});