Closed
Description
Recently we have migrated react-native-testing-library from 9.1.0 to 12.4.0.
After the migration, we started receiving the following error when we ran the tests.
/builds/seller/mobile-core/microapps/gilgamesh-promotion/node_modules/@testing-library/react-native/build/screen.js:11
throw new Error(SCREEN_ERROR);
^
Error: `render` method has not been called
at Object.notImplemented (/builds/seller/mobile-core/microapps/gilgamesh-promotion/node_modules/@testing-library/react-native/src/screen.ts:7:9)
at toJSON (/builds/seller/mobile-core/microapps/gilgamesh-promotion/node_modules/@testing-library/react-native/src/queries/make-queries.ts:94:23)
at formatErrorMessage (/builds/seller/mobile-core/microapps/gilgamesh-promotion/node_modules/@testing-library/react-native/src/queries/make-queries.ts:106:19)
at appendElementTreeToError (/builds/seller/mobile-core/microapps/gilgamesh-promotion/node_modules/@testing-library/react-native/src/queries/make-queries.ts:223:32)
at Timeout.onTimeout [as _onTimeout] (/builds/seller/mobile-core/microapps/gilgamesh-promotion/node_modules/@testing-library/react-native/src/wait-for.ts:1[83](https://gitlab.trendyol.com/seller/mobile-core/microapps/gilgamesh-promotion/-/jobs/30696203#L83):24)
at listOnTimeout (node:internal/timers:569:17)
at processTimers (node:internal/timers:512:7)
The strange part is, that error occurs randomly in one of the test suits among 70. Failed suite is non-deterministic, error appears randomly in one of the suites. If I run tests for failed suit in isolation, they pass.
I've come across this StackOverflow question, it seems like other people came across this. I haven't opened this as a bug report since I can't reproduce it deterministically. Have you got any insight into why this might happen?