diff --git a/uni_modules/uts-tests/utssdk/Array.uts b/uni_modules/uts-tests/utssdk/Array.uts index 0f8432813023d41706c9d41997e6f34f52a9e857..518744273c58ed6fa80d39b2e9c15e4b50b486ca 100644 --- a/uni_modules/uts-tests/utssdk/Array.uts +++ b/uni_modules/uts-tests/utssdk/Array.uts @@ -256,7 +256,7 @@ export function testArray(): Result { expect(array1).toEqual([1, 100000, 21, 30, 4]); const array2 = [5, 1, 4, 2, 3]; - array2.sort((a: number, b: number):number => a - b); + array2.sort((a, b):Int => a - b); expect(array2).toEqual([1, 2, 3, 4, 5]); // const array3 = [5, "banana", 4, "apple", 3, "cherry", 2, "date", 1]; diff --git a/uni_modules/uts-tests/utssdk/JSON.uts b/uni_modules/uts-tests/utssdk/JSON.uts index cd6fc11460e73c067816000b3268f2885dc3607f..0400dd3858b34a9825687d6bcd823cbf2d8d5460 100644 --- a/uni_modules/uts-tests/utssdk/JSON.uts +++ b/uni_modules/uts-tests/utssdk/JSON.uts @@ -13,7 +13,7 @@ export function testJSON() : Result { const json = `{"result":true, "count":42}`; const obj = JSON.parse(json)!; expect(obj["count"]).toEqual(42); - expect(obj["result"]).toEqual(true); + expect(obj["result"] as boolean).toEqual(true); const json1 = `{ "name": "John", diff --git a/uni_modules/uts-tests/utssdk/Matchers.uts b/uni_modules/uts-tests/utssdk/Matchers.uts index d51e8f03974a44cc9ab548e7ece67609244d5f91..5818ccd9389fa5ba6b4104b2ed62c793e6795680 100644 --- a/uni_modules/uts-tests/utssdk/Matchers.uts +++ b/uni_modules/uts-tests/utssdk/Matchers.uts @@ -12,7 +12,7 @@ export class Matchers { throw new Error(format(expected, this.actual)) // #endif // #ifdef APP-IOS - NSException(name = NSExceptionName.internalInconsistencyException, reason = format(expected, this.actual)).raise() + // NSException(name = NSExceptionName.internalInconsistencyException, reason = format(expected, this.actual)).raise() // #endif } } diff --git a/uni_modules/uts-tests/utssdk/String.uts b/uni_modules/uts-tests/utssdk/String.uts index ab02b596a273b541c28f14d7d14341033c7c90ff..4ef1e490f9e6463c47ee108616ed6e6dd5ee65b7 100644 --- a/uni_modules/uts-tests/utssdk/String.uts +++ b/uni_modules/uts-tests/utssdk/String.uts @@ -164,12 +164,12 @@ export function testString(): Result { const regex = /Dog/i; expect(p.replace(regex, 'ferret')).toEqual("The quick brown fox jumps over the lazy ferret. If the dog reacted, was it really lazy?"); const str = 'abc12345#$*%'; - const replacer = (match:string, p1:string, p2:string, p3:string, offset:number, string:string): string => { + const replacer = (match:string, p: string[], offset:number, string:string): string => { // p1 is nondigits, p2 digits, and p3 non-alphanumerics expect(offset).toEqual(0); expect(match).toEqual(str); expect(string).toEqual(str); - return [p1, p2, p3].join(' - '); + return p.join(' - '); } var newString = str.replace(/([^\d]*)(\d*)([^\w]*)/, replacer); expect(newString).toEqual("abc - 12345 - #$*%");