Mocks and Spies (spyOn)
Spies monitor function calls during tests.
Example
Section titled “Example”it("should call service method", () => { const service = jasmine.createSpyObj("DataService", ["getData"]);
service.getData.and.returnValue("test");
expect(service.getData()).toBe("test");});