zigbee2mqtt/test/utils.js
2019-06-10 00:01:48 +02:00

15 lines
576 B
JavaScript

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