diff options
| author | mattjmorrison <[email protected]> | 2013-12-05 22:44:10 -0600 |
|---|---|---|
| committer | mattjmorrison <[email protected]> | 2013-12-05 22:44:10 -0600 |
| commit | 8bf0bf952cba404d3c0b49f22783cf49ba1dbb8f (patch) | |
| tree | 43e4a2777fa2dfb2d8d77f2c32e9c408c6ad9074 /test/logger.js | |
| parent | be9cf789b3db0158b8364a48475e5671d45f16e8 (diff) | |
| download | node-coveralls-8bf0bf952cba404d3c0b49f22783cf49ba1dbb8f.tar.xz node-coveralls-8bf0bf952cba404d3c0b49f22783cf49ba1dbb8f.zip | |
Added ability to turn on debug logging via environment variable
For the grunt-karma-coveralls project, I need to be able to turn on
debug level logging but without using `process.argv`. This will allow me
to do so.
This addresses this issue:
https://github.com/mattjmorrison/grunt-karma-coveralls/issues/2
and can be fixed with this commit:
https://github.com/mattjmorrison/grunt-karma-coveralls/commit/4bd6e2b58647dda4a6335fa6077334d8021e23c0
Diffstat (limited to 'test/logger.js')
| -rw-r--r-- | test/logger.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/logger.js b/test/logger.js index c6899db..61d20bc 100644 --- a/test/logger.js +++ b/test/logger.js @@ -8,4 +8,25 @@ describe("logger", function(){ var logger = require('../index').logger(); logger.level.should.equal('debug'); }); + + it ("should log at debug level when NODE_COVERALLS_DEBUG is set in env", function(){ + process.argv = []; + process.env.NODE_COVERALLS_DEBUG = 1; + var logger = require('../index').logger(); + logger.level.should.equal('debug'); + }); + + it ("should log at debug level when NODE_COVERALLS_DEBUG is set in env as a string", function(){ + process.argv = []; + process.env.NODE_COVERALLS_DEBUG = '1'; + var logger = require('../index').logger(); + logger.level.should.equal('debug'); + }); + + it ("should log at warn level when NODE_COVERALLS_DEBUG not set and no --verbose", function(){ + process.argv = []; + process.env.NODE_COVERALLS_DEBUG = 0; + var logger = require('../index').logger(); + logger.level.should.equal('warn'); + }); }); |
