From 3.x to 4.x, is there a new way to use request() ?
See original GitHub issueif I call my API in this way using Supertest 4.x:
return res.status(401).send()
and try to assert it in this way:
response = await request(app).post('/admin').send( { data_here } )
expect(response.status).toBe(401);
Supertest returns Unauthorized
and not status code 401 as I’m expecting.
If I do the same thing using Supertest 3.x , it returns the status code I’m expecting to test it.
Is there a new way to do it on version 4.x ?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Migrate apps from Azure Functions version 3.x to 4.x
The easiest way is to upgrade without slots and then republish your app project. You can also minimize the downtime in your app...
Read more >Migrating from 3.x to 4.0 - Socket.IO
Breaking changes. io.to() is now immutable; wsEngine option · Configuration. Ensure compatibility with Swift v15 clients; The default value of ...
Read more >Migrating from 3.x to 4.x · expressjs/express Wiki - GitHub
This method is no longer available. If you wish to configure different routes based on environment, use either an if statement or another...
Read more >Upgrading from 3.x to 4.x — CodeIgniter 4.2.11 documentation
There is no 12-step checklist for upgrading. Instead, start with a copy of CodeIgniter 4 in a new project folder, however you wish...
Read more >Migrating from Spring Security 3.x to 4.x (XML Configuration)
This guide is intended to help users migrate from Spring Security 3.x to Spring Security 4.x when using XML based configuration.
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
Same here, used this in 3.x:
Short migration guide would be nice
@SMenigat should not the person who created the fix also add the tests which verifies the error wont happen again? Also should it not be the maintainers job to have meaningful tests for their own product?