Provide an option to run unit tests without automatic resolution of providedIn root services
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Current behavior
Services providedIn root are auto-resolved in unit tests. Therefore missing mock for the service stays a hidden issue. For unit testing it would be better if the test fails and we as developers would have to provide a proper mock for the service or provide it explicitly.
This issue is discussed in detail here: https://github.com/angular/angular/issues/25593 https://github.com/angular/angular/pull/26088
Expected behavior
Given a central(?) config/property we can prohibit auto-providing services with a providedIn root declaration.
Minimal reproduction of the problem with instructions
See the related angular issue and PR.
What is the motivation / use case for changing the behavior?
It would be nice if spectator would have an option for this until the angular world finds a solution it can live with. And in the meantime the rest of us would have another reason for using spectator.
Environment
Angular version: 9.1.0
Browser: Browser-independent
For Tooling issues:
- Node version: independent
- Platform: independent