-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
Injecting services for component integration tests doesn't seem to work #114
Comments
Use the service name only (not the type and the name):
|
I'm sorry, I actually was using |
Hmm. It should be working. Can you make a demo repo that I can use to track down the issue your are seeing? |
@rwjblue To clarify, |
Your component would still need |
That was my problem then--a misunderstanding. I have an application injection inject |
initializers do not run in integration tests, I suppose in general you could import the initializer function and call it from your setup/beforeEach block, but that seems much less useful. I find using
|
I'm going to close this, as I believe we are now on the same page |
Yep, not a bug. Thanks @rwjblue |
For posterity, another alternative is passing in the service when you call render. E.g.
|
Yep |
Though I personally prefer to test the actual template invocation that will be used. |
Yeah, I think I prefer just injecting it manually. I'm all for self-documenting code, and doing this in 1 line versus 2 in every test is a no brainer. |
The following code using
this.inject.service
never seems to inject the service into the component before trying to render.The text was updated successfully, but these errors were encountered: