How to write unit test for the component with service dependencies -Angular | Component Service test

Опубликовано: 16 Октябрь 2024
на канале: World Tech Tube
3,477
25

Share, Support, Subscribe!!
Subscribe: https://bit.ly/3kk36Nh
Youtube:    / worldtechtube  

** Angular Unit Testing using Jasmine and Karma **
We will learn:
1. What is Jasmine & how to use that in angular testing.
2. What is Karma & how to use that in angular testing.
   • Angular Unit Testing using Jasmine an...  

In this video we will be writing the angular unit test for the component that is using the service dependencies.
we will create a mock of the service method and use that stub to the provider in order to provide the fake calling to the service.
we will then call the component methods and verify the services data through stubService.