mercredi 11 avril 2018

Mocking components. Folder structure and ng language service

I need to mock a child component to test the parent component. The NO_ERRORS_SCHEMA does not work in my case since the child components provides a ValueAccessor. Now I have already mocked the child components with the ValueAccessor implementation. Now I have 2 questions:

  • Where do I put the mocks? An extra top level testing folder? In the child components spec file?
  • Since the component mock is not included in a normal module, only the TestBed module, the language service is throwing an error, that the component is not declared in a Module. How can I exclude mocks from this check?

Aucun commentaire:

Enregistrer un commentaire