提交 3c0fbaed 编写于 作者: 雪洛's avatar 雪洛

test: UniError constructor 增加无参数,1参数测试

上级 caefc892
...@@ -9,6 +9,11 @@ export function testError(): Result { ...@@ -9,6 +9,11 @@ export function testError(): Result {
expect((e as Error).message).toEqual("Whoops!"); expect((e as Error).message).toEqual("Whoops!");
} }
}) })
test('UniError', () => {
expect(new UniError().message).toEqual('')
expect(new UniError('Whoops!').message).toEqual('Whoops!')
})
// test('name', () => { // test('name', () => {
// const e = new Error("Malformed input"); // e.name is 'Error' // const e = new Error("Malformed input"); // e.name is 'Error'
// e.name = "ParseError"; // e.name = "ParseError";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册