Spysetup ((install)) Review
describe('Checkout SpySetup', () => { let chargeSpy; let receiptSpy;
Spying on getters requires a different setup: spysetup
// setup.js (global test config) beforeAll(() => { // Global spy setup jest.spyOn(console, 'error').mockImplementation(() => {}); }); describe('Checkout SpySetup', () => { let chargeSpy; let
Sometimes you want the spy to record calls but change the behavior (partial mocking). { let chargeSpy
}); });