Skip to content

Commit ecc76e6

Browse files
committed
feat(docs): update unit testing docs to add new setup function and new resources
1 parent 69317da commit ecc76e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/src/content/docs/testing/unit-testing.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ As you may notice from the code, we are importing a bunch of things from the `@/
4747
You can update this file to add any other providers you need to wrap your components with as well as any other utility functions you need to use in your tests.
4848

4949
<CodeBlock file="src/core/test-utils.tsx" />
50+
51+
use `setup` function in case you need to test interactions with the component. It returns a user (userEvent) object that you can use to interact with the component.
5052
:::
5153

5254
Now that we have our test file ready, let's run it and see what happens. To run the test, run the following command:
@@ -73,3 +75,5 @@ Aiming for 100% test coverage is not always a good idea and doesn't always make
7375
For more complex logic and components, we recommend taking a look at this amazing project which provides a lot of examples and best practices for testing React Native apps using React Native Testing Library and Jest:
7476

7577
[⚡️ React Native Testing](https://github.com/vanGalilea/react-native-testing/)
78+
79+
[React Native Testing Library Cookbook](https://callstack.github.io/react-native-testing-library/cookbook/index)

0 commit comments

Comments
 (0)