supertest icon indicating copy to clipboard operation
supertest copied to clipboard

expect(500) passes if statusCode is undefined

Open Izhaki opened this issue 3 years ago • 1 comments

Was just using this library to write a test.

Being TDD, I wrote the test first and was expecting the code to return 500.

But the code was never written and actually threw so statusCode was not defined.

The test passed.

Don't think 500 === undefined is correct. I believe expect should fail in that case.

Izhaki avatar Dec 18 '21 22:12 Izhaki

Any example project / code snippet ?

DevDengChao avatar Aug 06 '22 04:08 DevDengChao