From 3c0fbaedb157ff9195230d4f5c4ab66618430a57 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Sun, 21 Apr 2024 16:16:26 +0800 Subject: [PATCH] =?UTF-8?q?test:=20UniError=20constructor=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=97=A0=E5=8F=82=E6=95=B0=EF=BC=8C1=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/Error.uts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/Error.uts b/uni_modules/uts-tests/utssdk/Error.uts index 12f4220..f96c36c 100644 --- a/uni_modules/uts-tests/utssdk/Error.uts +++ b/uni_modules/uts-tests/utssdk/Error.uts @@ -9,6 +9,11 @@ export function testError(): Result { expect((e as Error).message).toEqual("Whoops!"); } }) + + test('UniError', () => { + expect(new UniError().message).toEqual('') + expect(new UniError('Whoops!').message).toEqual('Whoops!') + }) // test('name', () => { // const e = new Error("Malformed input"); // e.name is 'Error' // e.name = "ParseError"; -- GitLab