Complete the code to create a mock service using Jasmine spy.
const mockService = jasmine.[1]('MyService');
Use createSpyObj to create a mock object with spy methods.
Complete the code to provide the mock service in the Angular test module.
TestBed.configureTestingModule({ providers: [{ provide: MyService, use[1]: mockService }] });Use useValue to provide a mock object instance as the service.
Fix the error in spying on the service method in the test.
spyOn(mockService, '[1]').and.returnValue(of(true));
Method names are case-sensitive and usually camelCase in Angular services.
Fill both blanks to create a mock service with two spy methods.
const mockService = jasmine.createSpyObj('MyService', [[1], [2]]);
Provide method names as strings in an array to create spies for each.
Fill all three blanks to spy on a method and set a return value in the test.
spyOn(mockService, [1]).and.[2](of([3]));
Use spyOn with the method name as a string, then and.returnValue to set the mock return value.
