Skip to content

Commit 7f9d98f

Browse files
authored
Merge pull request #338 from share/silence-logger-in-tests
Silence logger in tests
2 parents 960f5d1 + ccd53e7 commit 7f9d98f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

test/mocha.opts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
--reporter spec
22
--check-leaks
33
--recursive
4+
--file test/setup.js

test/setup.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var logger = require('../lib/logger');
2+
3+
if (process.env.LOGGING !== 'true') {
4+
// Silence the logger for tests by setting all its methods to no-ops
5+
logger.setMethods({
6+
info: function() {},
7+
warn: function() {},
8+
error: function() {}
9+
});
10+
}

0 commit comments

Comments
 (0)