We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a70c1a0 + ad699ed commit 70a3d00Copy full SHA for 70a3d00
README.md
@@ -125,6 +125,21 @@ describe('GET /users', function() {
125
});
126
```
127
128
+Or async/await syntax:
129
+
130
+```js
131
+describe('GET /users', function() {
132
+ it('responds with json', async function() {
133
+ const response = await request(app)
134
+ .get('/users')
135
+ .set('Accept', 'application/json')
136
+ expect(response.headers["Content-Type"]).toMatch(/json/);
137
+ expect(response.status).toEqual(200);
138
+ expect(response.body.email).toEqual('foo@bar.com');
139
+ });
140
+});
141
+```
142
143
Expectations are run in the order of definition. This characteristic can be used
144
to modify the response body or headers before executing an assertion.
145
0 commit comments