From 693e9be051ae9b6f9ec277d2a9170110ee2e7d2e Mon Sep 17 00:00:00 2001 From: duqingquan Date: Tue, 15 Aug 2023 11:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9json=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=20=E9=80=82=E9=85=8D=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/JSON.uts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uni_modules/uts-tests/utssdk/JSON.uts b/uni_modules/uts-tests/utssdk/JSON.uts index 7265e6d..c0c002b 100644 --- a/uni_modules/uts-tests/utssdk/JSON.uts +++ b/uni_modules/uts-tests/utssdk/JSON.uts @@ -11,7 +11,7 @@ export function testJSON() : Result { return describe("JSON", () => { test('parse', () => { const json = `{"result":true, "count":42}`; - const obj = JSON.parse(json)!; + const obj = JSON.parse(json) as UTSJSONObject; expect(obj["count"]).toEqual(42); expect(obj["result"] as boolean).toEqual(true); @@ -29,7 +29,7 @@ export function testJSON() : Result { const json2 = '{"string":"Hello","number":42,"boolean":true,"nullValue":null,"array":[1,2,3],"object":{"nestedKey":"nestedValue"}}'; - const obj2 = JSON.parse(json2)!; + const obj2 = JSON.parse(json2)!; expect(obj2).toEqual({ string: 'Hello', number: 42, -- GitLab