zigbee2mqtt/test/utils.js
qm3ster a93838be15 codemod: object-shorthand
Also fixed `new (` and `formatter` by hand.
2019-03-09 16:30:05 +01:00

14 lines
475 B
JavaScript

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