Closed bohni closed 1 month ago
POST https://httpbin.org/post Content-Type: application/json { "someFields": [ { "confidence": 1 }, { "confidence": 0.934 } ] } ?? js response.parsedBody.json.someFields[0].confidence == 1 ?? js response.parsedBody.json.someFields[1].confidence == 0.934
Assert:
?? js response.parsedBody.signatures[1].confidence == 0.934
This assert fails with message
response.parsedBody.signatures[1].confidence == 0.934 (AssertionError [ERR_ASSERTION]: response.parsedBody.signatures[1].confidence (0.934) == 0 - <path>
I have to convert the string into a number before the comparison, unfortunately I used parseInt there. With the next release, parseFloat will now be used
parseInt
parseFloat
Assert:
?? js response.parsedBody.signatures[1].confidence == 0.934
This assert fails with message
response.parsedBody.signatures[1].confidence == 0.934 (AssertionError [ERR_ASSERTION]: response.parsedBody.signatures[1].confidence (0.934) == 0 - <path>