-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Issue with spying on CommonModule
provider by default
#735
Comments
CommonModule
by defaultCommonModule
provider by default
Hi @GerkinDev, I hope you are fine. There is a recent change about However, if someone is providing a mock - then a mock I'll investigate it this week and provide a fix with the next release. |
Alright! Is it the same thing for |
Ah true. And the resolver too :) It was a fix to return mocks instead of real components based on current suite. The idea was to simplify popups / overlays testing. Might you create a separate issue with an example about the resolver? |
I've created an issue. Love the button to create an issue from a comment, github rocks! |
Hi @GerkinDev, only now I've read the full description :) I'm doing well, thanks for asking, yourself? There are 2 cool things: the summer is finally here and today Github has sent your donation to my bank account, Besides that, could you verify the fix? ng-mocks.zip It requires the preliminary call of ngMocks.globalMock(DomSanitizer); |
As mentioned in the other issue, I'm off for a few days, so I'll give you feedbacks soon. |
Hi @GerkinDev, no rush, as usually. There is a proper fix, I hope :) |
Hi there ! So, I can confirm that the ZIP you sent fixes the problem here :) I would not say you're the best, but you're pretty close lol |
Ahahahaha :) Thanks! Then I'll prepare a release next days. I think, it should also fix the issue with |
I thought that too and I just alt+tabbed from my test, that was unfortunatelly non conclusive. I'm deep diving on it to see exactly what's the deal with it. |
Ah, sad sad. Then, let's discuss it in #736 |
v12.2.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 ! I hope you're doing well, and I see you continue to do an amazing job on this lib.
I'm posting this issue because I've just migrated my app to ng12, and latest
ng-mocks
, and now, some things are broken. I don't know if this is directly related tong-mocks
itself or not, so I'd gladly take any indication.I used to spy on some
CommonModule
providers to check my calls, and it used to work fine:Here is the thing I had before:
package.json
setupJest.ts
After the update:
package.json
But now, all of my tests asserting on
DomSanitizer
methods calls fails. Seeing this RTFM, I've tried this:setupJest.ts
But still no luck.
So, have you an idea on what I should do ? Am I forced to mock it with
MockInstance
in each of my files ?🍻 cheers !
Footnote:
I guess this is related, but mocking
ComponentFactoryResolver
provider directly in some MockBuilder's call chains seems to not work either:The text was updated successfully, but these errors were encountered: