UNPKG

@barguide/template

Version:
23 lines (17 loc) 406 B
import { Calculator } from '../Calculator'; test('Calculator', () => { const { log } = global.console; // Setup const mockLog = jest.fn(); const instance = new Calculator({ debug: true, testing: true }); // Mock global.console.log = mockLog; // Trigger instance.logger('Testing'); expect(mockLog).toHaveBeenCalledWith('Testing'); // Reset global.console.log = log; });