Comparing version 2.5.0 to 2.6.0
module.exports = function(){ | ||
if (process.argv[2]) { | ||
if (~['-v', '--verbose'].indexOf(process.argv[2])) { | ||
return require('log-driver')({level : 'debug'}); | ||
} | ||
return require('log-driver')({level : getLogLevel()}); | ||
}; | ||
function getLogLevel(){ | ||
if (hasVerboseCommandLineOption() || hasDebugEnvVariable()) { | ||
return 'debug'; | ||
} | ||
return require('log-driver')({level : 'warn'}); | ||
}; | ||
return 'warn'; | ||
} | ||
function hasVerboseCommandLineOption(){ | ||
return process.argv[2] && ~['-v', '--verbose'].indexOf(process.argv[2]); | ||
} | ||
function hasDebugEnvVariable(){ | ||
return process.env.NODE_COVERALLS_DEBUG == 1; | ||
} |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"bugs": { | ||
@@ -11,0 +11,0 @@ "url": "https://github.com/cainus/node-coveralls/issues" |
@@ -89,2 +89,12 @@ #node-coveralls | ||
### [Poncho](https://github.com/deepsweet/poncho) | ||
Client-side JS code coverage using [PhantomJS](https://github.com/ariya/phantomjs), [Mocha](https://github.com/visionmedia/mocha) and [Blanket](https://github.com/alex-seville/blanket): | ||
- [Configure](http://visionmedia.github.io/mocha/#browser-support) Mocha for browser | ||
- [Mark](https://github.com/deepsweet/poncho#usage) target script(s) with `data-cover` html-attribute | ||
- Run your tests with a command like this: | ||
```sh | ||
./node_modules/.bin/poncho -R lcov test/test.html | ./node_modules/coveralls/bin/coveralls.js | ||
``` | ||
## Running locally | ||
@@ -91,0 +101,0 @@ |
@@ -11,2 +11,23 @@ var should = require('should'); | ||
}); | ||
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'); | ||
}); | ||
}); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
203936
6796
106
75