-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to avoid multiple instances during karma test run? #1097
Comments
your current project may be import externals libraries, and those externals libraries has use "mobx". |
In my little example project I import no other dependencies except mobx and can reproduce the warnings. After cloning the project, you can run |
I cloned your project "mobx-test"! I have a simple solution:
|
Works, thanks a lot for your support. |
After upgrading to version 3.2.1 I receive a lot of warnings about multiple instances of mobx in my test logs:
[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See https://github.com/mobxjs/mobx/issues/1082 for details.
I read #1082 but I have no clue why multiple mobx instances are created during a test run. There are no warnings in development or production mode.
My test stack comprises webpack, karma and jasmine. Even with the tiniest example project with almost no configuration I can reproduce this behavior. Is this a known problem or are there some things I have to take care to avoid multiple instances during a test run?
The text was updated successfully, but these errors were encountered: