Skip to content

Commit 932335c

Browse files
committed
docs: Fix variable name in custom-matcher-api code example (#8581)
1 parent 85d9698 commit 932335c

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- `[docs]` Add example to `jest.requireActual` ([#8482](https://github.com/facebook/jest/pull/8482)
2323
- `[docs]` Add example to `jest.mock` for mocking ES6 modules with the `factory` parameter ([#8550](https://github.com/facebook/jest/pull/8550))
2424
- `[docs]` Add information about using `jest.doMock` with ES6 imports ([#8573](https://github.com/facebook/jest/pull/8573))
25+
- `[docs]` Fix variable name in custom-matcher-api code example ([#8582](https://github.com/facebook/jest/pull/8582))
2526

2627
### Performance
2728

docs/ExpectAPI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ expect.extend({
172172
`Expected: ${this.utils.printExpected(expected)}\n` +
173173
`Received: ${this.utils.printReceived(received)}`
174174
: () => {
175-
const difference = diff(expected, received, {
175+
const diffString = diff(expected, received, {
176176
expand: this.expand,
177177
});
178178
return (
179179
this.utils.matcherHint('toBe', undefined, undefined, options) +
180180
'\n\n' +
181-
(difference && difference.includes('- Expect')
181+
(diffString && diffString.includes('- Expect')
182182
? `Difference:\n\n${diffString}`
183183
: `Expected: ${this.utils.printExpected(expected)}\n` +
184184
`Received: ${this.utils.printReceived(received)}`)

website/versioned_docs/version-24.0/ExpectAPI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ expect.extend({
173173
`Expected: ${this.utils.printExpected(expected)}\n` +
174174
`Received: ${this.utils.printReceived(received)}`
175175
: () => {
176-
const difference = diff(expected, received, {
176+
const diffString = diff(expected, received, {
177177
expand: this.expand,
178178
});
179179
return (
180180
this.utils.matcherHint('toBe', undefined, undefined, options) +
181181
'\n\n' +
182-
(difference && difference.includes('- Expect')
182+
(diffString && diffString.includes('- Expect')
183183
? `Difference:\n\n${diffString}`
184184
: `Expected: ${this.utils.printExpected(expected)}\n` +
185185
`Received: ${this.utils.printReceived(received)}`)

0 commit comments

Comments
 (0)