Skip to content

Commit 6308b6c

Browse files
authored
Fix docs: Update MockFunctions.md (#11556)
1 parent 0a210dc commit 6308b6c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: docs/MockFunctions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const result = [11, 12].filter(num => filterTestFn(num));
106106
console.log(result);
107107
// > [11]
108108
console.log(filterTestFn.mock.calls[0][0]); // 11
109-
console.log(filterTestFn.mock.calls[0][1]); // 12
109+
console.log(filterTestFn.mock.calls[1][0]); // 12
110110
```
111111

112112
Most real-world examples actually involve getting ahold of a mock function on a dependent component and configuring that, but the technique is the same. In these cases, try to avoid the temptation to implement logic inside of any function that's not directly being tested.

Diff for: website/versioned_docs/version-27.0/MockFunctions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const result = [11, 12].filter(num => filterTestFn(num));
106106
console.log(result);
107107
// > [11]
108108
console.log(filterTestFn.mock.calls[0][0]); // 11
109-
console.log(filterTestFn.mock.calls[0][1]); // 12
109+
console.log(filterTestFn.mock.calls[1][0]); // 12
110110
```
111111

112112
Most real-world examples actually involve getting ahold of a mock function on a dependent component and configuring that, but the technique is the same. In these cases, try to avoid the temptation to implement logic inside of any function that's not directly being tested.

0 commit comments

Comments
 (0)