TestBed and Component Fixture | Angular unit test case Tutorials with Jasmine & Karma
The Angular Test Bed (ATB) is a higher level Angular Only testing framework that allows us to easily test behaviors that depend on the Angular Framework.
We still write our tests in Jasmine and run using Karma but we now have a slightly easier way to create components, handle injection, test asynchronous behaviour and interact with our application.
When to Use ATB
It allows us to test the interaction of a directive or component with its template.
It allows us to easily test change detection.
It provide methods to create components and services for unit test case.
It allows us to test and use Angular’s DI framework.
It allows us to test using the NgModule configuration we use in our application.
It allows us to test user interaction via clicks and input fields
EmoticonEmoticon