Closed dcoomber closed 1 year ago
Thanks for catching this @dcoomber !
Would you be able to work on fixing this? The code is here
I have ended up proposing the use of https://github.com/chaijs/chai-http, but am uncertain if this is what you're looking for.
chai-http
.to.be.json
is merely a check that the response headers includes Content-Type: application/json
. In this form, the assertion would only ever be valid when comparing against res
and would not be usable for comparisons of subsets of the response structure.
Please let me know if you had a different solution in mind.
After reviewing https://www.chaijs.com/api/plugins/ along with stepping through some of the other assertions, I realised that we're looking to addProperty
and not addMethod
.
PR updated.
Description
isJson assertion returns the error
Invalid Chai property: json. Did you mean "to"?
Test collection
Test collection: https://github.com/dcoomber/exploring-bruno/tree/dpc_session_1/exploration/02-create/EE%20Bookings
Test request: "Retrieve a booking"
Screenshot