标签:service ogg call number log result unit strong test
it (‘should add two numbers‘, () => { const logger = jasmine.createSpyObj(‘LoggerService‘, [‘log‘]) // logger.log.and.returnValue();
const calculator = new CalculatorService(logger) const result = calculator.add(2,2) expect(result).toBe(4) expect(logger).toHaveBeenCalledTimes(1)
})
标签:service ogg call number log result unit strong test
原文地址:https://www.cnblogs.com/Answer1215/p/12289683.html