-
-
Notifications
You must be signed in to change notification settings - Fork 76
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: update NgModuleWithProviders interface #149
Conversation
Hi. Thanks for the PR. Please add a new interface MockNgModule... that fits all angular versions and we need to add angular 10 to e2e tests too. |
@satanTime To my understanding I just need to change
to
And of course remove the unused import from @angular/core. Please clarify if thats what you meant by Please add a new interface MockNgModule... that fits all angular version. P.S. My windows decided to update will add base for e2e tests after update is finished. |
Yep. Makes sense |
For angular 10. please check in code :a9, the same things should be done for :a10. |
At the moment only angular10-ivy-true tests are failing, but I will be only able to debug further tomorrow in the evening. |
Hi. Thanks for the info. I’m on vacation until Tuesday and won’t be available either. No rush then. Next week we can solve it. |
All the tests succeed locally.
Currently, I am using a string to check the availability of these methods as older versions did not have the inject method available. I think it would be best to create a utility function or constant that can be imported into tests, but I am not sure where would be the best location to place it... Any guidance on how to fix testBedInjector implementation to succeed on Travis would be appreciated. |
first of all thanks for the effort, I checked it yesterday and due to braking changes in ts 3.9 (especially TS2339) to add support of angular 10 requires more changes than a removal of generic, I'll overtake this task. |
expect(mock).toEqual(jasmine.any(CustomComponent)); | ||
|
||
// checking that it was processed through Mock | ||
expect(mock.__ngMocksMock as any).toBe(true); | ||
expect(mock.__ngMocksMockControlValueAccessor as any).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately, it won't work like that and should be properly fixed to support TS 3.9. Due to required number of changes in architecture I have to overtake this task.
@satanTime I just pushed one last change. I will no longer push new changes on this. Let me know if you need further assistance :) |
@vytautas-petrikas, thanks again, might you squash all commits together? I'll try to use your branch as a base one for the full fix. |
build: base for angular 10 e2e tests fix: remove dependency on interface from angular fix: change names in the index.html files fix: do not inject APP_INITIALIZER token for version 10 fix: add helper constant testBedInjector fix: compile Ivy dependencies for parallel test predictability build: move testBedInjector into utils folder fix: remove unused imports fix: explicitly cast inject method as any for Angular 5 fix: cast TestBed to any instead of the key value fix: cast mock to any
fa19bba
to
b1a81b1
Compare
I have squashed the commits |
Hi again, thanks for the effort, unfortunately, with all changes it required a lot of investigation and it was easier to provide a separate PR to fix all of them. |
This should resolve the issue with Angular 10 #148.
However, I am not sure if versions prior to 9 will be compatible...
Either we need to remove the dependency on ModuleWithProviders from angular or to start documenting which ng-mocks versions should be used with which angular version.
Please let me know if anything needs to be adjusted.