-
-
Notifications
You must be signed in to change notification settings - Fork 96
Bug: NG205 Injector has already been disposed #11324
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
Comments
I assume it's because of #10825 |
https://stackblitz.com/edit/github-vatrfd7a-tjr14249 looks like after |
Faced the same issue |
Same here |
@satanTime I would appreciated if you publish this fix |
100% |
I'm really looking forward to it 😄 because I'm just now encountering this problem again on another project |
v14.13.5 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. |
For me, unfortunately, nothing has changed. Let's wait until author of this ticket check it. |
This has fixed my issue. Remember you'll need to tell the TestBed that you do not want to destory. const built = MockBuilder(TestComponent).build();
TestBed.configureTestingModule({
...built,
teardown: { destroyAfterEach: false },
});
return await TestBed.compileComponents(); |
Good. I'll take a look deeper once I've got a spare moment. |
So, I use @cheng93 actually, you example is working but as I mentioned above we don't use |
One more thing, it happened after upgrade Angular from 17 to 19 version and upgrade |
I believe I believe
I have provided a sample on how to configure TestBed, however it looks like you want I think to get 14.13.2 behaviour you can also do the following somewhere (test.ts?) getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
{
teardown: {
destroyAfterEach: false
}
}
); Disclaimer: Everything above could be wrong 😄 |
Description of the bug
Getting the error in the title
An example of the bug
Expected vs actual behavior
ng-mocks: 14.13.2 https://stackblitz.com/edit/github-vatrfd7a - works
ng-mocks: 14.13.3 https://stackblitz.com/edit/github-vatrfd7a-6lzfrewh - does not work
ng-mocks: 14.13.3 https://stackblitz.com/edit/github-vatrfd7a-jb25u2dw - attempt to not destroy after each - does not work
The text was updated successfully, but these errors were encountered: