diff --git a/uni_modules/uts-tests/utssdk/Array.uts b/uni_modules/uts-tests/utssdk/Array.uts index 3c0fcd189fa7a210ba47f5a4e4c0bab2bae51c6b..5251a110aa3697caaaf5b35bd8d62e92896ca65a 100644 --- a/uni_modules/uts-tests/utssdk/Array.uts +++ b/uni_modules/uts-tests/utssdk/Array.uts @@ -184,12 +184,18 @@ export function testArray(): Result { x : number y : number } - // #ifndef APP-IOS + // #ifdef WEB const s = JSON.parse(JSON.stringify([{ x: 0, y: 0 }])) as P[] s[0].x += 0; - const clearList = s.map((v : P, _, _) : number => v.x) + const clearList = s.map((v : P, _, a) : number => v.x) expect(clearList.includes(0)).toEqual(true); // #endif + // #ifdef APP-ANDROID + const s = JSON.parse(JSON.stringify([{ x: 0, y: 0 }])) as P[] + s[0].x += 0; + const clearList = s.map((v : P, _, _) : number => v.x) + expect(clearList.includes(0)).toEqual(true); + // #endif // #ifdef APP-IOS const s = JSON.parse(JSON.stringify([{ x: 0, y: 0 }])!) as P[] s[0].x += 0; diff --git a/uni_modules/uts-tests/utssdk/Date.uts b/uni_modules/uts-tests/utssdk/Date.uts index aa0b0a243070fb3072fb08e178a9b93cd3ca9606..2a7c880f178b10469ed8c74341832bad3d299d3c 100644 --- a/uni_modules/uts-tests/utssdk/Date.uts +++ b/uni_modules/uts-tests/utssdk/Date.uts @@ -3,17 +3,24 @@ import { describe, test, expect, Result } from './tests.uts' export function testDate() : Result { return describe("Date", () => { test('now', () => { - UTSAndroid.getDispatcher("io").async(function(_){ + // #ifdef APP-ANDROID + UTSAndroid.getDispatcher("io").async(function(_){ + const start = Date.now() + setTimeout(() => { + const millis = Date.now() - start + const secondsElapsed = Math.floor(millis / 1000) + expect(secondsElapsed).toEqual(2); + }, 2000) + },null) + // #endif + // #ifndef APP-ANDROID const start = Date.now() setTimeout(() => { const millis = Date.now() - start - console.log("start",start) - console.log("millis",millis) - console.log("currentThread",Thread.currentThread().getName()) const secondsElapsed = Math.floor(millis / 1000) expect(secondsElapsed).toEqual(2); }, 2000) - },null) + // #endif }) test('new Date', () => {