From e4aa0b50b3aae39ebfcdf854c9bbb26dea17beb7 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Mon, 21 Aug 2023 17:29:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E9=83=A8=E5=88=86=20typeOf?= =?UTF-8?q?=20=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/KeyWord.uts | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/uni_modules/uts-tests/utssdk/KeyWord.uts b/uni_modules/uts-tests/utssdk/KeyWord.uts index aeea449..03daec5 100644 --- a/uni_modules/uts-tests/utssdk/KeyWord.uts +++ b/uni_modules/uts-tests/utssdk/KeyWord.uts @@ -16,13 +16,21 @@ export function testKeyWord(): Result { }) test('typeof', () => { - let new1 = new User() - expect(typeof(new1)).toEqual('object') - expect(typeof(123456.789)).toEqual('number') - expect(typeof("hello world")).toEqual('string') - console.log(typeof([1,2,3])) - let arr1 = new Array() - console.log(arr1) + let new1 = new User() + expect(typeof(new1)).toEqual('object') + expect(typeof(123456.789)).toEqual('number') + expect(typeof(789778979798797987979)).toEqual('number') + expect(typeof(0.0)).toEqual('number') + expect(typeof("hello world")).toEqual('string') + expect(typeof([1,2,3])).toEqual('object') + expect(typeof(new Array())).toEqual('object') + expect(typeof(new Set())).toEqual('object') + expect(typeof(new Map())).toEqual('object') + expect(typeof(new Date())).toEqual('object') + expect(typeof("hello world")).toEqual('string') + // 原生对象 + expect(typeof(UTSAndroid.getUniActivity())).toEqual('object') + }) -- GitLab