Skip to content
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

MockModule creates mocks for imported modules which then creates conflicts #70

Closed
DaSchTour opened this issue Jan 10, 2020 · 5 comments · Fixed by #91
Closed

MockModule creates mocks for imported modules which then creates conflicts #70

DaSchTour opened this issue Jan 10, 2020 · 5 comments · Fixed by #91
Assignees
Labels
bug Something isn't working

Comments

@DaSchTour
Copy link

If you have a test for Component A which imports a module B as a mock an module C as a non mock module C is not allowed to be part of module B because then a mock for module C is generated which then creates conflicting components.

@satanTime
Copy link
Member

Hi @DaSchTour, you are right, unfortunately, that's a current limitation. Also for the proper correct testing whole environment should be mocked, except testing component.

If you need to avoid a dependency from mocking, I would suggest - declare it right in the declarations beside testing component.

Your issue can be closed as a duplicate of #44. Once it's implemented you can specify what to mock and what to don't mock without an issue.

@satanTime satanTime self-assigned this Mar 1, 2020
@satanTime satanTime linked a pull request Mar 9, 2020 that will close this issue
17 tasks
@satanTime satanTime added the bug Something isn't working label Mar 9, 2020
@satanTime satanTime mentioned this issue Mar 21, 2020
17 tasks
@satanTime
Copy link
Member

satanTime commented Mar 28, 2020

Hi @DaSchTour,

might you test the issue on 10.0.0-alpha.1 with the MockBuilder https://www.npmjs.com/package/ng-mocks/v/10.0.0-alpha.1#mockbuilder ?

@satanTime
Copy link
Member

Hi @DaSchTour, any update? You can try improved 10.0.0-alpha.3

@DaSchTour
Copy link
Author

Hey, I'll have to check and find my example. Lot of work and lot of refactoring later I can't currently find it. Will need to rebuild it probably. Sorry. Hope I'll find some time for that soon.

@satanTime
Copy link
Member

Totally agree, if you don't mind I would suggest to close the issue and feel free to reopen it or to submit a new one. Quite sure the issue has been fixed, because I met the same problem before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants