forwardemail / forwardemail/supertest
Is it correct to say that you can't use await when you have an `expect` handler?
Open
- Dominant language
- JavaScript
- Stars
- 14.4k
- Forks
- 782
- PR merge metrics
- No merged PRs in 30d
Description
I noticed that the following code:
```
await request.put('/foo').send({}).expect(OK, (err, res) => { /* ... */)
```
Triggers a double callback bug.
I know that `expect` calls `end` if you give it a handler.
I'm guessing that `await` effectively calls `then`, which leads to the double callback.
Is this your understanding? If so, is it worth documenting this, because it took me a long time to figure out and I have a pretty strong grasp of await/async and Promises. Might be a real doozy for some less experienced folks?
Contributor guide
Assessment
This issue has not been assessed yet.