jest: deemphasize async

This commit is contained in:
Rico Sta. Cruz 2017-09-01 05:21:54 +08:00
parent 356719d5a7
commit 7fe5d5ccbd
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 20 additions and 20 deletions

40
jest.md
View File

@ -54,26 +54,6 @@ describe('My work', () => {
`it` is an alias for `test`.
See: [test()](http://facebook.github.io/jest/docs/en/api.html#testname-fn)
### Asynchronous tests
```js
test('works with promises', () => {
return new Promise((resolve, reject) => {
···
})
})
```
```js
test('works with async/await', async () => {
const hello = await foo()
···
})
```
Return promises, or use async/await.
See: [Async tutorial](http://facebook.github.io/jest/docs/en/tutorial-async.html)
### Setup
```js
@ -199,6 +179,26 @@ expect.assertions(1)
More features
-------------
### Asynchronous tests
```js
test('works with promises', () => {
return new Promise((resolve, reject) => {
···
})
})
```
```js
test('works with async/await', async () => {
const hello = await foo()
···
})
```
Return promises, or use async/await.
See: [Async tutorial](http://facebook.github.io/jest/docs/en/tutorial-async.html)
### Snapshots
```jsx