Files
zigbee2mqtt/test/utils.js
T
2019-03-10 13:32:36 +01:00

14 lines
500 B
JavaScript

const logger = require('../lib/util/logger');
module.exports = {
stubLogger: (jest) => {
jest.spyOn(logger, 'info').mockImplementation(() => {});
jest.spyOn(logger, 'warn').mockImplementation(() => {});
jest.spyOn(logger, 'debug').mockImplementation(() => {});
jest.spyOn(logger, 'error').mockImplementation(() => {});
},
zigbeeMessage: (device, cid, type, data, epId) => {
return {data: {cid, data}, type, endpoints: [{device, epId}]};
},
};