Skip to content

Commit

Permalink
Merge pull request #22876 from pascalfiv/patch-1
Browse files Browse the repository at this point in the history
added information that jest is not globally available

(cherry picked from commit f57e67f)
  • Loading branch information
jonniebigodes authored and github-actions[bot] committed Jun 27, 2023
1 parent 2505b6e commit 810375e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/essentials/interactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ The above example uses the `canvasElement` to scope your element queries to the
While you can refer to the [Testing Library documentation](https://testing-library.com/docs/) for details on how to use it, there's an important detail that's different when using the Storybook wrapper: **method invocations must be `await`-ed**. It allows you to step back and forth through your interactions using the debugger.

Any `args` that have been marked as an Action, either using the [argTypes annotation](./actions.md#action-argtype-annotation) or the [argTypesRegex](./actions.md#automatically-matching-args), will be automatically converted to a [Jest mock function](https://jestjs.io/docs/mock-function-api) (spy). This allows you to make assertions about calls to these functions.

<div class="aside">

ℹ️ To mock functions in your Storybook stories for reliable and isolated component testing, use the `jest` import from `@storybook/jest`. This allows you to avoid configuring Jest globally in your project.

</div>

0 comments on commit 810375e

Please sign in to comment.