-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Every it
causes an additional MockMiddleware...
component to be created
#576
Comments
Hi @tmercswims, thanks for the report. It is something what I'm currently trying to tackle. I think next days there will be a fix for it. |
Oh okay, that's great to hear! If you don't mind, could you provide some insight as to why this is a problem for me in this particular test file, but not in any of my others? Is it the dependency thing that I described at the end? |
If I'm not mistaken, |
You are absolutely correct, it doesn't. I didn't even think to check that, how silly of me. Well, that means I have the easy "workaround" of adding a selector to the component declaration, which worked for me just now. From my perspective this issue is resolved, but please feel free to keep it open if you'd like to use it to track the fix you mentioned earlier. Thanks so much for your help and quick responses! |
Glad to hear 👍 Yep, thanks. I'll use this issue as a ref for the fix. |
v12.0.1 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. |
First of all, thank you very much for this wonderful package, it has made my life testing an Angular application with tons of services so much better.
I've encountered a strange issue, that I suspect is user error. But I can't for the life of me figure out what I'm doing wrong here, especially because I've used the exact same pattern in a dozen other test files and everything has worked without issue. Just this random one is having a problem.
I can provide my actual test file if its required, but it contains enough company-private information that I'd prefer not to, at least for now. But this is the general idea:
If you look at the errors, you can see that each subsequent test has another of the same component which is conflicting. If I were to re-order these three
it
s, whichever one is first will always pass, and all the subsequent ones will always fail with an increasing number of duplicate components.As I said, I've used this exact pattern (i.e.
MockBuilder()
in thebeforeAll
and thenMockRender()
in thebeforeEach
) in a dozen or more test files, so I really can't figure out why this is only a problem for this one.The only weirdness that I can think of which might potentially be an issue is that
MyComponent
injectsComponentScopedService
in its constructor, andComponentScopedService
injectsMyOtherService
in its constructor, so maybe there's some dependency resolution or order of declaration problems with that?Any help would be appreciated. Thank you very much!
The text was updated successfully, but these errors were encountered: