From 328f666817755d38f807d71047760532ea256a9b Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Tue, 27 Feb 2024 18:01:51 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0type=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/Type.uts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/Type.uts b/uni_modules/uts-tests/utssdk/Type.uts index 1f521ea..77ee22d 100644 --- a/uni_modules/uts-tests/utssdk/Type.uts +++ b/uni_modules/uts-tests/utssdk/Type.uts @@ -13,6 +13,23 @@ export function testType() : Result { age: 2 } as Person + expect(a instanceof Person).toEqual(true); + expect(b instanceof Person).toEqual(true); + }) + test("Type with any[]", () => { + type Person = { + age: number, + friends: any[] + } + const a: Person = { + age: 1, + friends: ['b'] + } + const b = { + age: 2, + friends: ['a'] + } as Person + expect(a instanceof Person).toEqual(true); expect(b instanceof Person).toEqual(true); }) -- GitLab