AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
222 stars 20 forks source link

Doesn't assert number value #260

Closed rabestro closed 4 months ago

rabestro commented 4 months ago

The request file:

{{host}}/actuator/health

?? status == 200
?? body status == UP
?? body components.diskSpace.status == UP
?? body components.diskSpace.details.total > 0
?? body components.diskSpace.details.free > 0

Error message

✖: components.diskSpace.details.total > 0 (AssertionError [ERR_ASSERTION]: components.diskSpace.details.total (36671356928) > 0 - /Users/jegors/.vscode/extensions/anweber.vscode-httpyac-6.11.4/dist/extension.js:191:46440)
✖: components.diskSpace.details.free > 0 (AssertionError [ERR_ASSERTION]: components.diskSpace.details.free (17609199616) > 0 - /Users/jegors/.vscode/extensions/anweber.vscode-httpyac-6.11.4/dist/extension.js:191:46440)

AnWeber commented 4 months ago

A standard mistake that I unfortunately always make. 0 is falsy and I had a check to see if the value was present. Please simply change the check to > 1 until the bugfix is released

{{host}}/actuator/health

?? status == 200
?? body status == UP
?? body components.diskSpace.status == UP
?? body components.diskSpace.details.total > 1
?? body components.diskSpace.details.free > 1