[Pkg-javascript-commits] [node-coveralls] 241/332: Modify tests to reflect minimist usage
Bastien Roucariès
rouca at moszumanska.debian.org
Thu Nov 9 13:54:06 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-coveralls.
commit 125d8b15e9fd8e6c9c67f4d54f12ea72b87049a3
Author: Anna Henningsen <sqrt at entless.org>
Date: Wed Apr 15 17:24:49 2015 +0200
Modify tests to reflect minimist usage
The tests now modify the options object directly instead of
modifying `process.argv`
To allow using this tool with Coveralls Enterprise, I've added
support in `sendToCoveralls` to read the host from a `COVERALLS_ENDPOINT`
environment variable (if it exists), else default to coveralls.io (as before).
---
test/logger.js | 8 ++++----
test/sendToCoveralls.js | 5 +++--
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/test/logger.js b/test/logger.js
index 15767ff..19767df 100644
--- a/test/logger.js
+++ b/test/logger.js
@@ -4,27 +4,27 @@ var index = require('../index');
describe("logger", function(){
it ("should log at debug level when --verbose is set", function(){
- process.argv[2] = '--verbose';
+ index.options.verbose = true;
var logger = require('../index').logger();
logger.level.should.equal('warn');
});
it ("should log at debug level when NODE_COVERALLS_DEBUG is set in env", function(){
- process.argv = [];
+ index.options.verbose = false;
process.env.NODE_COVERALLS_DEBUG = 1;
var logger = require('../index').logger();
logger.level.should.equal('warn');
});
it ("should log at debug level when NODE_COVERALLS_DEBUG is set in env as a string", function(){
- process.argv = [];
+ index.options.verbose = false;
process.env.NODE_COVERALLS_DEBUG = '1';
var logger = require('../index').logger();
logger.level.should.equal('warn');
});
it ("should log at warn level when NODE_COVERALLS_DEBUG not set and no --verbose", function(){
- process.argv = [];
+ index.options.verbose = false;
process.env.NODE_COVERALLS_DEBUG = 0;
var logger = require('../index').logger();
logger.level.should.equal('error');
diff --git a/test/sendToCoveralls.js b/test/sendToCoveralls.js
index 2224f0b..6121bbb 100644
--- a/test/sendToCoveralls.js
+++ b/test/sendToCoveralls.js
@@ -27,6 +27,7 @@ describe("sendToCoveralls", function(){
});
var obj = {"some":"obj"};
+
index.sendToCoveralls(obj, function(err, response, body){
err.should.equal('err');
response.should.equal('response');
@@ -51,7 +52,7 @@ describe("sendToCoveralls", function(){
done();
});
});
- it ("writes output to stdout when --write is passed", function(done) {
+ it ("writes output to stdout when --stdout is passed", function(done) {
var obj = {"some":"obj"};
// set up mock process.stdout.write temporarily
@@ -65,7 +66,7 @@ describe("sendToCoveralls", function(){
origStdoutWrite.apply(this, arguments);
};
- process.argv[2] = '--write';
+ index.options.stdout = true;
index.sendToCoveralls(obj, function(err, response, body) {
response.statusCode.should.equal(200);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-coveralls.git
More information about the Pkg-javascript-commits
mailing list