diff --git a/uni_modules/uts-tests/utssdk/JSON.uts b/uni_modules/uts-tests/utssdk/JSON.uts index bcf43842a52148caae6c7690b01e8d9cff4dfcec..031669d80538f68bbda9f8b4670c22267fa6c9af 100644 --- a/uni_modules/uts-tests/utssdk/JSON.uts +++ b/uni_modules/uts-tests/utssdk/JSON.uts @@ -239,6 +239,22 @@ export function testJSON() : Result { expect(JSON.stringify(params)).toEqual('{"args":[{"url":"/pages/index/index"}],"method":"reLaunch"}') + class Stage { + $m: string + $p: Array + constructor(){ + this.$m = 'test' + this.$p = ['type'] + } + } + + const obj22 = { + data: [new Stage()] as Array + } as UTSJSONObject + + expect(JSON.stringify(obj22)).toEqual('{"data":[{"$m":"test","$p":["type"]}]}') + + }) test('invalidField', () => {