forwardemail / forwardemail/supertest

Add async/await examples to documentation

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

Description

I didn't realize until after using this library for a few days that `supertest.Test` (the return value for `.get`, `.expect` etc) extends `Promise` after a few generations of inheritance.

This means that you can do the following:
```js
import request from 'supertest'
const response = await request.get('/').expect(200)
```

One key thing to note is that `.end` should NOT be called when using `async/await`

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.