Closed firebait closed 1 year ago
It looks like this might be a version mismatch issue Which version of Angular and shallow-render are you using?
For example, EnvironmentProviders
were just added in Angular v15 so if the isEnvironmentProviders
function is not available it would suggest you're using v15 of shallow-render but < v15 of Angular.
See the compatibility table and make sure you align versions properly.
For example, if you're on Angular 14, install shallow-render@14
:
$> npm i -D shallow-render@14
Closed due to inactivity. I feel there is a high chance the comment above was the solution.
Hi all, this is more of a question than a bug. We have a large project with no testing and I was hoping to encourage more testing by using this library. I'm not sure why but shallow seems to struggle trying to render any component in the application. When I first try to render I get the following error. Note:
SharedModule
is one of the modules in our application as well asSharedUtilsModule
.I followed the recommendations and did
.neverMock
and after several rounds of Whac-a-mole and adding more.neverMock
for a lot of other modules I now get this error:I assume this is not normal as the issue with Angular testing was that you had to setup a bunch of boilerplate in order to get the tests to run but now I seem to need to setup a lot of boilerplate to prevent mocking modules.
Any ideas on where should I start my debugging?