Writing Unit Tests with Jest
What Jest feature is being utilized here?
const spy = jest.spyOn(console, 'log');
try {
someFunction();
expect(spy).toHaveBeenCalledWith('expected output');
} finally {
spy.mockRestore();
}
const spy = jest.spyOn(console, 'log');
try {
someFunction();
expect(spy).toHaveBeenCalledWith('expected output');
} finally {
spy.mockRestore();
}