提交 33a52411 编写于 作者: 杜庆泉's avatar 杜庆泉

json stringify add

上级 4f243816
...@@ -239,6 +239,22 @@ export function testJSON() : Result { ...@@ -239,6 +239,22 @@ export function testJSON() : Result {
expect(JSON.stringify(params)).toEqual('{"args":[{"url":"/pages/index/index"}],"method":"reLaunch"}') expect(JSON.stringify(params)).toEqual('{"args":[{"url":"/pages/index/index"}],"method":"reLaunch"}')
class Stage {
$m: string
$p: Array<any>
constructor(){
this.$m = 'test'
this.$p = ['type']
}
}
const obj22 = {
data: [new Stage()] as Array<any>
} as UTSJSONObject
expect(JSON.stringify(obj22)).toEqual('{"data":[{"$m":"test","$p":["type"]}]}')
}) })
test('invalidField', () => { test('invalidField', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册