getsaf / shallow-render

Angular testing made easy with shallow rendering and easy mocking. https://getsaf.github.io/shallow-render
MIT License
273 stars 25 forks source link

jest-preset-angular upgrade is causing shallow-render to fail with the constructor #218

Closed dean-g closed 2 years ago

dean-g commented 2 years ago
This constructor is not compatible with Angular Dependency Injection because its dependency at index 0 of the parameter list is invalid.
    This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.

    Please check that 1) the type for the parameter at index 0 is correct and 2) the correct Angular decorators are defined for this class and its ancestors.

Can someone please advise on this issue?

getsaf commented 2 years ago

Could you post a reproduction? This isn't much to go off of. I'm using jest-preset-angular without issue in this repo.

FrEaKmAn commented 2 years ago

I have the same issue and it seems FormsModule is causing some issues on my side.

Do we have a latest stackblitz with jest support that I could use to prepare a reproduction?