From 6308b6c8e43b0f2a4301c224b6c2177dd3270fc9 Mon Sep 17 00:00:00 2001 From: Sebastian Aberastury Date: Mon, 21 Jun 2021 06:47:51 -0300 Subject: [PATCH] Fix docs: Update MockFunctions.md (#11556) --- docs/MockFunctions.md | 2 +- website/versioned_docs/version-27.0/MockFunctions.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/MockFunctions.md b/docs/MockFunctions.md index 3e2ccf7a3d15..ad566722e828 100644 --- a/docs/MockFunctions.md +++ b/docs/MockFunctions.md @@ -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. diff --git a/website/versioned_docs/version-27.0/MockFunctions.md b/website/versioned_docs/version-27.0/MockFunctions.md index 3e2ccf7a3d15..ad566722e828 100644 --- a/website/versioned_docs/version-27.0/MockFunctions.md +++ b/website/versioned_docs/version-27.0/MockFunctions.md @@ -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.