Open jkepps opened 1 year ago
@jkepps did you find the solution? had same issue
I fixed it by adding jest.useFakeTimers()
, on beforeEach
block in the affected test files
I fixed it by adding
jest.useFakeTimers()
, onbeforeEach
block in the affected test files
How about if must use the real timer in some test cases?
I am also having this issue, and I cannot use fake timers.
I encountered a similar issue with the same error, for some reason the CLI had the NODE_ENV set to "development". Unsetting the NODE_ENV resolved the issue.
After migrating to react native 0.72, a simple jest test with react testing library gives the following error about a hundred times and the test fails:
ReferenceError: You are trying to access a property or method of the Jest environment after it has been torn down. From src/components/form/CollapsibleFormField/index.test.tsx.
Here is the component and its test:
here is the test output: