Isolating global states between tests
Isolating global states between tests
I use the Testing Library to implement unit and integration tests. I have components sharing global states maintained by Hookstate. What is the correct way to write tests for these components and not have problems when the tests are run in parallel?
Thanks in advance for any support.
parallel tests should run in separate worker threads, each having its own copy of the runtime and ram state... at least it is the case with jest and playwright... what test framework do you use?
next.js + jest + testing library
so, jest runs tests in parallel by default in isolated worker threads... please make sure it is the case
@avkonst
That's right! I ended up getting confused by the concept. The context, window and any global states are not shared between tests, right?
I believe it has nothing to do with Hookstate.
Even so, thanks for your reply.