zigbee2mqtt/test/stub/logger.js
2019-09-25 10:55:50 +02:00

17 lines
326 B
JavaScript

let level = 'info';
const mock = {
info: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
debug: jest.fn(),
trace: jest.fn(),
cleanup: jest.fn(),
setLevel: (newLevel) => {level = newLevel},
getLevel: () => level,
};
jest.mock('../../lib/util/logger', () => (mock));
module.exports = {...mock};