Question: What statement best describes this usage of the TestBed?

  1. The TestBed is required anytime you want to make use of a spy object in a unit test for an Angular provider.
  2. The TestBed is being used to test a component's view.
  3. 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.
  4. 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.