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

增加 JSON.parse<string>的测试示例

上级 113f55bc
......@@ -512,5 +512,28 @@ export function testJSON() : Result {
})
test('parse-type-string', () => {
// #ifndef APP-ANDROID
let bb2 = JSON.parse<string>('{"a":12}')
console.log(typeof bb2)
let bb3 = JSON.parse<string>('7897987')
console.log(typeof bb3)
let bb4 = JSON.parse<string>('null')
console.log(typeof bb4)
expect(bb2).toEqual('{"a":12}')
expect(typeof bb2).toEqual("string")
expect(bb3).toEqual('7897987')
expect(typeof bb3).toEqual("string")
expect(bb4).toEqual('null')
expect(typeof bb4).toEqual("string")
// #endif
})
})
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册