1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import test from "ava";
|
7 | import { CustomError } from "..";
|
8 |
|
9 | test("constructor", t => {
|
10 | let customError: CustomError = new CustomError();
|
11 | t.deepEqual(customError.name, "");
|
12 | t.deepEqual(customError.message, "");
|
13 | customError = new CustomError({ name: "test" });
|
14 | t.deepEqual(customError.name, "test");
|
15 | t.deepEqual(customError.message, "");
|
16 | customError = new CustomError({ message: "test" });
|
17 | t.deepEqual(customError.name, "");
|
18 | t.deepEqual(customError.message, "test");
|
19 | customError = new CustomError({ name: "test1", message: "test2" });
|
20 | t.deepEqual(customError.name, "test1");
|
21 | t.deepEqual(customError.message, "test2");
|
22 | });
|