This project looks awesome. Tried to implement it in my own project with inspiration from this repo. After some time of debugging I decided to run tests in this repo:
β― yarn test
yarn run v1.22.17
$ jest
PASS __tests__/ListWithFetch.test.tsx (11.019 s)
PASS __tests__/Counter.test.tsx (15.144 s)
PASS __tests__/CounterUsesCustomHook.test.tsx (15.282 s)
FAIL __tests__/LoginSubmission.test.tsx (15.342 s)
β renders correctly
thrown: "Exceeded timeout of 5000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
24 | })
25 |
> 26 | it('renders correctly', async () => {
| ^
27 | const mockNavigate = jest.fn()
28 | // @ts-ignore
29 | useNavigation.mockImplementation(() => ({navigate: mockNavigate}))
at Object.<anonymous> (__tests__/LoginSubmission.test.tsx:26:1)
FAIL __tests__/Login.test.tsx (15.305 s)
β renders correctly
thrown: "Exceeded timeout of 5000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
5 | import {expect, it, jest} from '@jest/globals'
6 |
> 7 | it('renders correctly', async () => {
| ^
8 | const username = 'hi'
9 | const password = 'qwerty1234'
10 | let submittedData = {}
at Object.<anonymous> (__tests__/Login.test.tsx:7:1)
FAIL __tests__/Video.test.tsx (15.456 s)
β renders/navigates throughout app screens
thrown: "Exceeded timeout of 5000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
11 | }
12 |
> 13 | it('renders/navigates throughout app screens', async () => {
| ^
14 | const {getByText, getByA11yLabel} = render(
15 | <Video navigation={navigationMock} />,
16 | )
at Object.<anonymous> (__tests__/Video.test.tsx:13:1)
PASS __tests__/EasyButton.test.tsx (16.765 s)
FAIL __tests__/FlatList.test.tsx (16.827 s)
β scrolls to top and refreshes all items
thrown: "Exceeded timeout of 5000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
30 | }
31 |
> 32 | it('scrolls to top and refreshes all items', async () => {
| ^
33 | const {getByText, getByTestId} = render(<SectionList />)
34 |
35 | getByText(/pizza/i)
at Object.<anonymous> (__tests__/FlatList.test.tsx:32:1)
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From __tests__/FlatList.test.tsx.
at getNodeByText (node_modules/@testing-library/react-native/build/helpers/byText.js:53:9)
at node_modules/@testing-library/react-native/build/helpers/byText.js:73:44
at _findAll (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:17085:7)
at ReactTestInstance.findAll (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:17012:12)
at queryAllByTextFn (node_modules/@testing-library/react-native/build/helpers/byText.js:73:28)
PASS __tests__/Home.test.tsx (16.983 s)
FAIL __tests__/Modal.test.tsx (17.271 s)
β renders modal screen correctly
thrown: "Exceeded timeout of 5000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
14 | })
15 |
> 16 | it('renders modal screen correctly', async () => {
| ^
17 | const {getByText} = render(<ModalScreen />)
18 |
19 | expect(() => getByText(/hello world/i)).toThrow(
at Object.<anonymous> (__tests__/Modal.test.tsx:16:1)
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From __tests__/Modal.test.tsx.
at getNodeByText (node_modules/@testing-library/react-native/build/helpers/byText.js:53:9)
at node_modules/@testing-library/react-native/build/helpers/byText.js:73:44
at _findAll (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:17085:7)
at ReactTestInstance.findAll (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:17012:12)
at queryAllByTextFn (node_modules/@testing-library/react-native/build/helpers/byText.js:73:28)
A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks.
Test Suites: 5 failed, 5 passed, 10 total
Tests: 5 failed, 11 passed, 16 total
Snapshots: 1 passed, 1 total
Time: 18.333 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.