UNPKG

726 BPlain TextView Raw
1/* tslint:disable:no-implicit-dependencies no-any */
2/**
3 * CustomError tests
4 */
5
6import test from "ava";
7import { CustomError } from "..";
8
9test("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});