-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(tests): "no provider" error when running tests #963
Conversation
Current coverage is 90.39% (diff: 100%)
@@ development #963 diff @@
=============================================
Files 26 26
Lines 781 781
Methods 142 142
Messages 0 0
Branches 115 115
=============================================
Hits 706 706
Misses 75 75
Partials 0 0
|
@Igonato why is this not needed for |
There is "imports" param in TestBed.configureTestingModule where you can pass FormsModule or whatever you need. |
@otelnov this is not working, please see the related issue. |
@Martin-Wegner I don't see any datepicker-popup.component what branch are you on? As for the others what I did is I imported every ng2-bootstrap module and specified providers field for components that would fail the tests. Test DI doesn't fail for every component nor for every provider, so far it only does so with NgModel and some components. My guess is that some circular dependency needs to happen that can be resolved in the browser but not in testing. |
@Igonato I have dropped it completely (datepicker-popup.component ) until it is working properly |
@valorkin what was/is wrong with it? And what do you think about this PR? Did you review the changes, any comments? |
as temporary solution should work, but will have to find more generic solution later @Igonato thanks for your time! :) |
Fix for #929
Seems like DI derps in the test environment and not able to resolve providers using the new NgModule system. For tests to pass components need to have providers field.