forwardemail / forwardemail/supertest
Update README with examples using async/await
Open
- Dominant language
- JavaScript
- Stars
- 14.4k
- Forks
- 782
- PR merge metrics
- No merged PRs in 30d
Description
I have a feeling that most people use async/await in new code, and none of the examples use it.
Also, from browsing random issues, better tests will be written using this structure. For example #543 is caused by not using async/await in tests.
```
// This passes!
it("should reset", async () => {
request(app)
.get("/reset")
.expect(205);
});
```
```
// This fails!
it("should reset", async () => {
const res = await request(app).get("/reset");
expect(res.status).toBe(205);
});
```
Contributor guide
Assessment
This issue has not been assessed yet.