How do I return two different values from this mock service when I am providing it in the initial test for the component? I want to be able to return two different values for two different tests from mock service
describe('example', () => { let component: ExampleComponent; let fixture: ComponentFixture<ExampleComponent>; let mockService: Partial<MockService>; beforeEach(async(() => { mockService = { mockMethodSpy: jasmine.createSpy('mockMethod') }; TestBed.configureTestingModule({ declarations: [ ExampleComponent], imports: [], providers: [ { provide: MockService, useValue: mockService }, ] }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(ExampleComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should return true from mock service', () => { expect(mockService.mockMethodSpy).toBe(true); }); it('should return false from mock service', () => { expect(mockService.mockMethodSpy).toBe(false); }); });