-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
"MockInstance: side effects have been detected" hard to track #1046
Comments
Hi @GerkinDev, Yep, I still think about how to find the best way to mock them before initialization, and that jest issue, which is ignored by maintainers, spoils everything. Usually, what I do is that I enable additional logging myself, then, at least, it helps to understand affected tests: https://github.com/ike18t/ng-mocks/blob/master/karma-test-shim.ts#L39-L46 Not sure if it's working for jest without the jasmine runner. |
Also, a question. Did you configure this setup: https://ng-mocks.sudo.eu/extra/install#default-customizations? Or you use jest 27+? |
I think I found the issue. Please check the next release once it has been published. It was caused by afterEach(() => MockInstance(SomeClass)); // no config didn't reset the tracker. |
Hi there ! Sorry, I was quite busy laying some code to write EBNF syntax on the fly lol I didn't had the time to try those options. I'll try it next time I leave my feature branch Cheers ! |
v12.5.0 has been released and contains a fix for the issue. Feel free to reopen the issue or to submit a new one if you meet any problems. |
Hi there ! Hope you're doing well and that you took some time for yourself during the summer !
I've seen recently that
ng-mocks
triggers warnings aboutMockInstance
incorrectly cleaned up. Thing is, I have plenty of tests, and plenty of files, so its kinda hard to find where the issue occurs. Would it be possible to add a context or something ? Or add an option so that affected test fails completely ?🍻 cheers !
The text was updated successfully, but these errors were encountered: