In this article we will learn how to write unit tests in for services and component in an Angular app using the Jasmine framework and karma .
Before proceeding with Angular unit test case , we should have knowledge on angular.
You can learn angular 8 from below link
https://www.youtube.com/watch?v=n6TDWpJ-qjs&list=PL5Agzt13Z4g_AVsqkZtsykXZPLcA40jVC
https://www.youtube.com/TheDotNetOffice
Part 1:- Introduction of Jasmine & Karma
Part 2: How Angular Unit test case Flow
Part 3: How to run angular unit test cases
Part 4: Configuration Jasmine & Karma With Angular
Part 5:-First Angular Unit test case
Part 6:- Exclude Angular unit test case from Execution
Part 7:- Jasmin Matchers in angular unit test case
Part 8:- ToBe and ToEqual in-built matcher in angular unit test
Part 9:- toBe(true), toBeTrue() and toBeTruthy() , toBeFalse() and toBeFalsy() Jamine matcher
Part 10 - toBeGreaterThan() ,toBeGreaterThanOrEqual() ,toBeLessThan() ,toBeLessThanOrEqual() Matcher
Part 11- toMatch() and toBeCloseTo() Jasmin Matcher
Part 12- toBeDefined and toBeUndefined Jasmine matcher
Part 13- tobenull() ,tocontain() ,tobeNan() , toBePositiveInfinity, toBeNegetiveInfinity matcher
Part 14- BeforeEach and AfterEach Jasmine functions
Part 15- BeforeAll and AfterAll in Jasmin Method
Part 16- Arrange-Act-Assert(AAA) Pattern
Part 17- TestBed and Component Fixture
Part 18- SpyOn to mock and Stub methods in angular unit test
Part 19 - Change detection in angular unit test
Part 20- Debug Element & DOM events in angular unit test
Part 21- Call Private Method and private variable in angular unit test
Part 22- SpyOn Private Method in angular unit test
Part 23- Angular Unit test on interpolation
Part 24- Angular Unit test on property binding
Part 25- Angular Unit test on ngClass and ngStyle Binding
EmoticonEmoticon