Skip to content

Commit

Permalink
Fix docs: Update MockFunctions.md (#11556)
Browse files Browse the repository at this point in the history
  • Loading branch information
seastian authored Jun 21, 2021
1 parent 0a210dc commit 6308b6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/MockFunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const result = [11, 12].filter(num => filterTestFn(num));
console.log(result);
// > [11]
console.log(filterTestFn.mock.calls[0][0]); // 11
console.log(filterTestFn.mock.calls[0][1]); // 12
console.log(filterTestFn.mock.calls[1][0]); // 12
```

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.
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-27.0/MockFunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const result = [11, 12].filter(num => filterTestFn(num));
console.log(result);
// > [11]
console.log(filterTestFn.mock.calls[0][0]); // 11
console.log(filterTestFn.mock.calls[0][1]); // 12
console.log(filterTestFn.mock.calls[1][0]); // 12
```

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.
Expand Down

0 comments on commit 6308b6c

Please sign in to comment.