Error.uts 500 字节
Newer Older
Y
yurj26 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import { describe, test, expect, Result } from './tests.uts'

export function testError(): Result {
    return describe("Error", () => {
        test('message', () => {
            try {
              throw new Error('Whoops!')
            } catch (e) {
              expect(e.message).toEqual("Whoops!");
            }
        })
        // test('name', () => {
        //     const e = new Error("Malformed input"); // e.name is 'Error'
        //     e.name = "ParseError";
        // })
    })
}