Skip to content

Commit f8f8a51

Browse files
committed
Add missing import to docs
1 parent d62167d commit f8f8a51

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
- `[babel-plugin-jest-hoist]`: Migrate to TypeScript ([#7898](https://github.com/facebook/jest/pull/7898))
4646
- `[@jest/core]` Create new package, which is `jest-cli` minus `yargs` and `prompts` ([#7696](https://github.com/facebook/jest/pull/7696))
4747
- `[@jest/transform]`: Migrate to TypeScript ([#7918](https://github.com/facebook/jest/pull/7918))
48+
- `[docs]` Add missing import to docs ([#7928](https://github.com/facebook/jest/pull/7928))
49+
4850

4951
### Performance
5052

docs/Es6ClassMocks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ Calls to jest.mock are hoisted to the top of the code. You can specify a mock la
155155

156156
```javascript
157157
import SoundPlayer from './sound-player';
158+
import SoundPlayerConsumer from './sound-player-consumer';
159+
158160
jest.mock('./sound-player');
159161

160162
describe('When SoundPlayer throws an error', () => {

website/versioned_docs/version-23.x/Es6ClassMocks.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ Calls to jest.mock are hoisted to the top of the code. You can specify a mock la
156156

157157
```javascript
158158
import SoundPlayer from './sound-player';
159+
import SoundPlayerConsumer from './sound-player-consumer';
160+
159161
jest.mock('./sound-player');
160162

161163
describe('When SoundPlayer throws an error', () => {
@@ -176,6 +178,7 @@ describe('When SoundPlayer throws an error', () => {
176178
});
177179
```
178180

181+
179182
## In depth: Understanding mock constructor functions
180183

181184
Building your constructor function mock using `jest.fn().mockImplementation()` makes mocks appear more complicated than they really are. This section shows how you can create your own simple mocks to illustrate how mocking works.

website/versioned_docs/version-24.0/Es6ClassMocks.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ Calls to jest.mock are hoisted to the top of the code. You can specify a mock la
156156

157157
```javascript
158158
import SoundPlayer from './sound-player';
159+
import SoundPlayerConsumer from './sound-player-consumer';
160+
159161
jest.mock('./sound-player');
160162

161163
describe('When SoundPlayer throws an error', () => {
@@ -176,6 +178,7 @@ describe('When SoundPlayer throws an error', () => {
176178
});
177179
```
178180

181+
179182
## In depth: Understanding mock constructor functions
180183

181184
Building your constructor function mock using `jest.fn().mockImplementation()` makes mocks appear more complicated than they really are. This section shows how you can create your own simple mocks to illustrate how mocking works.

0 commit comments

Comments
 (0)