With Chai, you can create a spy object as follows:
chai.spy.object([ \'push\', \'pop\' ]);
With jasmine, you can use:
jasmi
I've written a very quick createSpyObj function for jest, to support the old project. Basically ported from Jasmine's implementation.
export const createSpyObj = (baseName, methodNames): { [key: string]: Mock } => {
let obj: any = {};
for (let i = 0; i < methodNames.length; i++) {
obj[methodNames[i]] = jest.fn();
}
return obj;
};