forwardemail / forwardemail/supertest

Update README with examples using async/await

Open
#620 0 comments 8 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.