为什么这个测试没有通过 fastxmlparser
import parser from 'fast-xml-parser'
test("fastxmlparser", () => {
let parsed = parser.parse('<detail><name>john</name><value>116347579610481033</value></detail>')
expect(parsed.detail.value).toBe('116347579610481033')
})
Expected value to be:
"116347579610481033"
Received:
116347579610481040
Difference:
Comparing two different types of values. Expected string but received number.
95 | test("fastxmlparser", () => {
96 | let parsed = parser.parse('<detail><name>john</name><value>116347579610481033</value></detail>')
> 97 | expect(parsed.detail.value).toBe('116347579610481033')
98 | })
99 |
100 |