-
Notifications
You must be signed in to change notification settings - Fork 14
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
Trouble testing component that uses the helper with a custom config #5
Comments
Ok, this seems to work but I'll bet there's a better way:
|
I've done this before, but remember it being a bit evil when I did it too & having to go through the container (now registry) like you're doing. The problem is, as you've seen, that initializers aren't run in component tests as the app isn't booted. I'll ask around and see what the best way of doing it is. I wonder if there's a way for the addon to hook into the tests so it sets up the initializer for you automagically? |
I'm having this issue too, @rlivsey have you figured out the best way of testing? |
I wrote my integration test like this:
|
I have a component that uses the helper with a custom config. It works perfectly in the app but now I am trying to write an integration test for it.
My first stab got me this:
Failed to create an instance of 'sanitizer:links-only'. Most likely an improperly defined class or an invalid module export.
So I figured I need to run the initializer. My test now looks something like this:
But now I get
container.registerOptionsForType is not a function
coming out of the initializer. I think I'm on the right track but I'm not sure what to pass to the initializer. Any suggestions? Thanks.The text was updated successfully, but these errors were encountered: