When testing a component that has sub-components you have a few options:
- Import the module that sets up the component and sub-components. Problem is you instantiate the real sub-components and their dependencies.
- Mock sub-components. This can be tedious depending on how many sub-components it has.
- Use
NO_ERRORS_SCHEMA
and ignore sub-components.
Given that most of the time you only care about the current component, why isn't NO_ERRORS_SCHEMA
given more attention in the testing tutorials, blog posts, etc.?
I know it's flagged as experimental but I'm not bothered by that since
- it's shipped with the rest of Angular, and
- the whole Angular stack is pretty much experimental given its history and the upcoming release cycle.
So are there problems with NO_ERRORS_SCHEMA
? Or is it just happenstance it's not promoted more?