-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From 3.x to 4.x, is there a new way to use request() ? #557
Comments
We used to set the expected status code, like 401, but that no longer returns the response, it throws the error instead. |
Same here, used this in 3.x: await request(app)
.post('/system/invoice/generate')
.set('content-type', 'application/json')
.set('Authorization', 'invalidtoken')
.send()
.expect(httpStatus.UNAUTHORIZED) Short migration guide would be nice |
This may be a regression - see ladjs/superagent#1466 |
same and has been reported yesterday but still no fixes. |
Don't you have any tests which cover these cases? I mean there was already something similar: |
Feel free to open an PR and add those tests 👍 |
I’ve started adding a few tests, the problem is all the tests use callbacks only, so the regression was overlooked, again (sorry!). |
Just to be clear, my comment was in @akirilyuk s direction. |
@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? |
+1 with @akirilyuk |
#558 merged, I close this issue. Thank you 🙏 |
This was blocked because of the following issue in Supertest but now it seems to be OK: ladjs/supertest#557 No issues expected.
This was blocked because of the following issue in Supertest but now it seems to be OK: ladjs/supertest#557 No issues expected.
This was blocked because of the following issue in Supertest but now it seems to be OK: ladjs/supertest#557 No issues expected.
This was blocked because of the following issue in Supertest but now it seems to be OK: ladjs/supertest#557 No issues expected. kiwicom-source-id: 02a0ff1ddb5ac6db2b24437efa759b0dbce4051a
This was blocked because of the following issue in Supertest but now it seems to be OK: ladjs/supertest#557 No issues expected. kiwicom-source-id: 02a0ff1ddb5ac6db2b24437efa759b0dbce4051a
This was blocked because of the following issue in Supertest but now it seems to be OK: ladjs/supertest#557 No issues expected. kiwicom-source-id: 02a0ff1ddb5ac6db2b24437efa759b0dbce4051a
This was blocked because of the following issue in Supertest but now it seems to be OK: ladjs/supertest#557 No issues expected. kiwicom-source-id: 02a0ff1ddb5ac6db2b24437efa759b0dbce4051a
if I call my API in this way using Supertest 4.x:
and try to assert it in this way:
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 ?
The text was updated successfully, but these errors were encountered: