Creates a new object with jasmine spies for each method in type.
type
class Greeter { greet(name: string) { return `Hello, ${name}!`; }}const spyObject = createSpyObject(Greeter);spyObject.greet.and.returnValue("Hello, stub!");expect(spyObject.greet("Eric")).toBe("Hello, stub!");expectSingleCallAndReset(spyObject.greet, "Eric"); Copy
class Greeter { greet(name: string) { return `Hello, ${name}!`; }}const spyObject = createSpyObject(Greeter);spyObject.greet.and.returnValue("Hello, stub!");expect(spyObject.greet("Eric")).toBe("Hello, stub!");expectSingleCallAndReset(spyObject.greet, "Eric");
Creates a new object with jasmine spies for each method in
type
.