Skip to content

Commit

Permalink
handleInput callback include body
Browse files Browse the repository at this point in the history
* version bump
  • Loading branch information
nickmerwin committed Aug 6, 2019
1 parent 55fc4d8 commit d3045b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/handleInput.js
Expand Up @@ -30,7 +30,7 @@ function handleInput(input, cb, userOptions) {
}
logger.debug(response.statusCode);
logger.debug(body);
cb(null);
cb(null, body);
});
});
}, userOptions);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -5,7 +5,7 @@
"coverage",
"coveralls"
],
"version": "3.0.5",
"version": "3.0.6",
"bugs": {
"url": "https://github.com/nickmerwin/node-coveralls/issues"
},
Expand Down
13 changes: 7 additions & 6 deletions test/handleInput.js
Expand Up @@ -10,7 +10,7 @@ describe("handleInput", function(){
});
it ("returns an error when there's an error getting options", function(done){
sinon.stub(index, 'getOptions', function(cb){
return cb("some error", {});
return cb("some error", {});
});
var path = __dirname + "/../fixtures/onefile.lcov";
var input = fs.readFileSync(path, "utf8");
Expand All @@ -21,7 +21,7 @@ describe("handleInput", function(){
});
it ("returns an error when there's an error converting", function(done){
sinon.stub(index, 'getOptions', function(cb){
return cb(null, {});
return cb(null, {});
});
sinon.stub(index, 'convertLcovToCoveralls', function(input, options, cb){
cb("some error");
Expand All @@ -35,7 +35,7 @@ describe("handleInput", function(){
});
it ("returns an error when there's an error sending", function(done){
sinon.stub(index, 'getOptions', function(cb){
return cb(null, {});
return cb(null, {});
});
sinon.stub(index, 'sendToCoveralls', function(postData, cb){
cb("some error");
Expand All @@ -49,7 +49,7 @@ describe("handleInput", function(){
});
it ("returns an error when there's a bad status code", function(done){
sinon.stub(index, 'getOptions', function(cb){
return cb(null, {});
return cb(null, {});
});
sinon.stub(index, 'sendToCoveralls', function(postData, cb){
cb(null, {statusCode : 500}, "body");
Expand All @@ -63,15 +63,16 @@ describe("handleInput", function(){
});
it ("completes successfully when there are no errors", function(done){
sinon.stub(index, 'getOptions', function(cb){
return cb(null, {});
return cb(null, {});
});
sinon.stub(index, 'sendToCoveralls', function(postData, cb){
cb(null, {statusCode : 200}, "body");
});
var path = __dirname + "/../fixtures/onefile.lcov";
var input = fs.readFileSync(path, "utf8");
index.handleInput(input, function(err){
index.handleInput(input, function(err, body){
(err === null).should.equal(true);
body.should.equal('body');
done();
});
});
Expand Down

0 comments on commit d3045b4

Please sign in to comment.