forwardemail / forwardemail/supertest

.redirects(number) keeps waiting, doesn't resolve in v6.2.2

Open
#754 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.4k
Forks
782
PR merge metrics
No merged PRs in 30d

Description

Hi,

we have something like this in tests:

```ts
const response = await supertest(getServer()).get('/auth').redirects(2);
```

And after update to v 6.2.2 the tests just hand on this line.
It doesn't resolve, doesn't throw, just hangs in there till the test timeout expires.

Could it be somehow related to the change in the superagent https://github.com/visionmedia/superagent/commit/e196345074f57987c166283c302d06d661744f14?
I don't actually see how it would affect `.redirects()`, but I don't see any other change.

I've tried to force superagent back to 7.0.2, and tests are working as expected.

Contributor guide

Open the contributing guide

Research direction

Start with the reported test expression, `await supertest(getServer()).get('/auth').redirects(2)`, and reproduce the hang on v6.2.2. Compare it with the working superagent 7.0.2 setup and inspect the linked superagent change for the redirect path. Done means `.redirects(2)` resolves or throws instead of waiting for the test timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.