Question: What statement best describes this usage of the TestBed?
- The TestBed is required anytime you want to make use of a spy object in a unit test for an Angular provider.
- The TestBed is being used to test a component's view.
- The TestBed scaffolds an NgModule with two providers and handles any dependency injection. If any Angular class requests the DataService in its constructor, the TestBed will inject spy in that constructor.
- The TestBed is configuring the test runner to tell it to only execute tests for the two providers listed in its providers array.
Answer: The correct answer of the above question is Option C:The TestBed scaffolds an NgModule with two providers and handles any dependency injection. If any Angular class requests the DataService in its constructor, the TestBed will inject spy in that constructor.