You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to use any of the find* queries in my tests, and I cannot get waitFor or act to work either. I haven't found any other instances of this error online. I can reproduce this issue using the exact code posted in this comment on a similar issue.
I have checked that I am not using jest.useFakeTimers anywhere.
Versions being used:
react-native: 0.61.5
react: 16.9.0
@testing-library/react-native: 7.2.0
I am getting the following error:
console.error
Warning: The callback passed to TestRenderer.act(...) function must not return anything.
It looks like you wrote TestRenderer.act(async () => ...) or returned a Promise from it's callback. Putting asynchronous logic inside TestRenderer.act(...) is not supported.
at warningWithoutStack$1 (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:102:32)
at act (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13176:9)
at call (node_modules/@testing-library/react-native/build/waitFor.js:69:9)
at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40)
at Generator._invoke (node_modules/regenerator-runtime/runtime.js:293:22)
at Generator.call (node_modules/regenerator-runtime/runtime.js:118:21)
at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40)
console.error
Warning: Do not await the result of calling TestRenderer.act(...), it is not a Promise.
at warningWithoutStack$1 (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:102:32)
at Object.then (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13185:11)
The text was updated successfully, but these errors were encountered:
I posted this issue in case someone else ever has the same problem as I did.
The problem turned out to be that I had my version of react-test-renderer set explicitly to 16.8.6 in my package.json. Updated that to 16.9.0 to match the react version and it's now working as expected.
In case of trouble you should also check if your React Native version matches React version, as this two packages are different versioning schemes you can use e.g. React Native Upgrade Helper to find a proper version match.
I am unable to use any of the
find*
queries in my tests, and I cannot getwaitFor
oract
to work either. I haven't found any other instances of this error online. I can reproduce this issue using the exact code posted in this comment on a similar issue.I have checked that I am not using
jest.useFakeTimers
anywhere.Versions being used:
react-native: 0.61.5
react: 16.9.0
@testing-library/react-native: 7.2.0
I am getting the following error:
The text was updated successfully, but these errors were encountered: