DEV Community

Discussion on: Angular Components Unit Test – Common Use Cases

Collapse
 
rebaiahmed profile image
Ahmed Rebai

And another question about {provide: ExampleService, useClass: ExampleServiceMock} : ExampleServiceMock it's implemneted from scratch ? or we can use mock test library

Collapse
 
nicholaalkhouri profile image
Nichola Alkhouri

It is up to you, you can create a new class that matches the real ExampleService and mock the members (properties and methods). you can use a mocking library if you want, but anyway it is up to you, depending on the logic of the service, to decide how the mock service should behave