Tests with error return fail with version 3.4.0
See original GitHub issueWhen using version 3.4.0 tests that test for backend returning an error (400) fail. Example:
it("Check that backend returns 400 with invalid data", async function() {
let res = await server
.post("/api/someurl")
.send({data: "something invalid"})
.expect("Content-type", /json/)
.expect(400);
});
When using version 3.4.0 this test fails with “Bad request” error even when backend returns correctly 400 status code.
With supertest 3.3.0 code works as expected.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Tests with error return fail with version 3.4.0 #534 - GitHub
When using version 3.4.0 tests that test for backend returning an error (400) fail. Example: it("Check that backend returns 400 with invalid ...
Read more >Unit Tests Failing After Updating React Scripts from v.3.4.4 to v ...
Basically, the main error I'm seeing seems to apply to any tests running against async/await methods. Jest reports that the test times out...
Read more >General tips and tricks — tox 3.4.0 documentation
When a command (defined by commands = in tox.ini ) fails, it has a non-zero exit code, and an InvocationError exception is raised...
Read more >COMMISSION SMART Tests fail unnecessarily on code 64 ...
If a disk has *old* indications of failure in its SMART log, a return code of 64 is provided. This causes MAAS to...
Read more >Mockito (Mockito 4.10.0 API) - javadoc.io
Minimizes repetitive mock creation code. Makes the test class more readable. Makes the verification error easier to read because the field name is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I am also experiencing the same issue!
Hi,
I have the same issue. As far as I checked, the problem probably with
superagent
version upgrade. It had a major version change. The error thrown fromnode_modules/superagent/lib/node/index.js:804:15)
because the_isResponseOK
function only accept status codes as valid between 200 and 300 (node_modules/superagent/lib/request-base.js
in row 275).But I am not familiar with that area.