initial commit
[squeep-mystery-box] / test / stub-logger.js
diff --git a/test/stub-logger.js b/test/stub-logger.js
new file mode 100644 (file)
index 0000000..5ac0b98
--- /dev/null
@@ -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