diff --git a/uni_modules/uts-tests/utssdk/Array.uts b/uni_modules/uts-tests/utssdk/Array.uts index 147e265e960c18273e66ad0907951b8254c9f92f..eed68566ce9f69765e37bcb7719f44315b363376 100644 --- a/uni_modules/uts-tests/utssdk/Array.uts +++ b/uni_modules/uts-tests/utssdk/Array.uts @@ -184,10 +184,19 @@ export function testArray(): Result { x : number y : number } - const s = JSON.parse(JSON.stringify([{ x: 0, y: 0 }])) as P[] - s[0].x += 0; - const clearList = s.map((v : P, _, _a) : number => v.x) - expect(clearList.includes(0)).toEqual(true); + // #ifndef APP-IOS + const s = JSON.parse(JSON.stringify([{ x: 0, y: 0 }])) as P[] + s[0].x += 0; + const clearList = s.map((v : P, _, _a) : number => v.x) + expect(clearList.includes(0)).toEqual(true);e); + // #endif + // #ifdef APP-IOS + const s = JSON.parse(JSON.stringify([{ x: 0, y: 0 }])!) as P[] + s[0].x += 0; + const clearList = s.map((v : P, index: number, _a) : number => v.x) + expect(clearList.includes(0)).toEqual(true); + // #endif + }) test("indexOf", () => { diff --git a/uni_modules/uts-tests/utssdk/String.uts b/uni_modules/uts-tests/utssdk/String.uts index 8ebf9887f2fd4680d9cf003b211b93a08b329528..602a2936e2a279e4f37a0a5b4883daec24caaf7d 100644 --- a/uni_modules/uts-tests/utssdk/String.uts +++ b/uni_modules/uts-tests/utssdk/String.uts @@ -63,10 +63,10 @@ export function testString(): Result { expect("ABC".charCodeAt(0)).toEqual(65); expect("ABC".charCodeAt(1)).toEqual(66); expect("ABC".charCodeAt(2)).toEqual(67); - expect("ABC".charCodeAt(3)).toEqual(null); + expect("ABC".charCodeAt(3)).toEqual(NaN); const empty = ""; - expect(empty.charCodeAt(0)).toEqual(null); + expect(empty.charCodeAt(0)).toEqual(NaN); }) test('fromCharCode', () => { expect(String.fromCharCode(65, 66, 67)).toEqual("ABC");