X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fstub-logger.js;fp=test%2Fstub-logger.js;h=5ac0b984fc33608c9860755e799ff8552049865d;hb=9696c012e6b9a6c58904baa397ca0ebf78112316;hp=0000000000000000000000000000000000000000;hpb=f59e918f3aba3a218c94a252072801fc40527647;p=websub-hub diff --git a/test/stub-logger.js b/test/stub-logger.js new file mode 100644 index 0000000..5ac0b98 --- /dev/null +++ b/test/stub-logger.js @@ -0,0 +1,18 @@ +'use strict'; + +const sinon = require('sinon'); // eslint-disable-line node/no-unpublished-require + +const nop = () => { /* */ }; +const stubLogger = process.env.VERBOSE_TESTS ? console : { + debug: nop, + error: nop, + info: nop, +}; +stubLogger['_reset'] = () => { + sinon.spy(stubLogger, 'debug'); + sinon.spy(stubLogger, 'error'); + sinon.spy(stubLogger, 'info'); +}, + + +module.exports = stubLogger; \ No newline at end of file