Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Can't override providers while unit-testing downgraded angular 2 components. #8675
I'm having an issue while trying to mock Http requests for Ng2 components downgraded to Ng1.
With pure Ng2, I am able to to override providers easily using
But I can't find a way to override providers on an Ng1/Ng2 hybrid app using
Here is an example where the mocking works if the provider is not defined in the component:
You can then produce the problem by uncommenting the line at
Thank you in advance!
Found the trick! You have to inject the mock DirectiveProvider into the updateAdapter.