Skip to content

Commit

Permalink
Fix 22.4 docs for mockResolveValue (#5916)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii authored Apr 3, 2018
1 parent 0d58623 commit 1eb02fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/versioned_docs/version-22.4/MockFunctionAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ console.log(myMockFn(), myMockFn(), myMockFn(), myMockFn());
Simple sugar function for:

```js
jest.fn().mockImplementation(() => Promise.resolve(value));
jest.fn().mockReturnValue(Promise.resolve(value));
```

Useful to mock async functions in async tests:
Expand All @@ -263,7 +263,7 @@ test('async test', async () => {
Simple sugar function for:

```js
jest.fn().mockImplementationOnce(() => Promise.resolve(value));
jest.fn().mockReturnValueOnce(Promise.resolve(value));
```

Useful to resolve different values over multiple async calls:
Expand All @@ -288,7 +288,7 @@ test('async test', async () => {
Simple sugar function for:

```js
jest.fn().mockImplementation(() => Promise.reject(value));
jest.fn().mockReturnValue(Promise.reject(value));
```

Useful to create async mock functions that will always reject:
Expand All @@ -306,7 +306,7 @@ test('async test', async () => {
Simple sugar function for:

```js
jest.fn().mockImplementationOnce(() => Promise.reject(value));
jest.fn().mockReturnValueOnce(Promise.reject(value));
```

Example usage:
Expand Down

0 comments on commit 1eb02fd

Please sign in to comment.