You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importmockfrom"xhr-mock";/** * ... setup and teardown ... */it("should make jest fail",function(){expect.assertions(1);mock.get("/",function(req,res){expect(true).toBe(false);returnres.status(200);});// ... send GET request to "/" ...});
As expected, this should make Jest fail, but instead, Jest passes, and the following error is logged to console.error:
xhr-mock: A handler returned an error for the request.
GET / HTTP/1.1
Error: expect(received).toBe(expected) // Object.is equality
Expected: false
Received: true
at /<path to test file folder>/test.js:LL:CC
at /<path to project home>/node_modules/xhr-mock/lib/createMockFunction.js:23:24
at /<path to project home>/node_modules/xhr-mock/lib/handle.js:24:24
at processTicksAndRejections (node:internal/process/task_queues:96:5)
The text was updated successfully, but these errors were encountered:
I have the following code:
As expected, this should make Jest fail, but instead, Jest passes, and the following error is logged to
console.error
:The text was updated successfully, but these errors were encountered: