Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
skip upload tests if offline
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnetCarpenter committed Aug 31, 2016
1 parent 925f194 commit fc1106b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"execSync": "1.0.2"
},
"devDependencies": {
"expect.js": "0.3.1",
"istanbul": "0.4.4",
"jshint": "2.9.2",
"mocha": "2.5.3"
"expect.js": "^0.3.1",
"istanbul": "^0.4.5",
"jshint": "^2.9.3",
"mocha": "^3.0.2"
}
}
17 changes: 10 additions & 7 deletions test/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if (!execSync) {

describe("Codecov", function(){
it("can get upload to v2", function(done){
var self = this;
codecov.sendToCodecovV2('https://codecov.io',
{
token: 'f881216b-b5c0-4eb1-8f21-b51887d1d506',
Expand All @@ -24,14 +25,16 @@ describe("Codecov", function(){
},
function(errCode, errMsg){
if(errCode === 'EAI_AGAIN'){
console.log('Offline - can not run this test');
done();
self.skip(); // offline - we can not test upload
return;
}
throw err;
throw new Error(errMsg);
});
});

it("can get upload to v3", function(done){
var self = this;
this.timeout(3000); // give this test extra time to run (default is 2000ms)
codecov.sendToCodecovV3('https://codecov.io',
{
token: 'f881216b-b5c0-4eb1-8f21-b51887d1d506',
Expand All @@ -45,10 +48,10 @@ describe("Codecov", function(){
},
function(errCode, errMsg){
if(errCode === 'EAI_AGAIN'){
console.log('Offline - can not run this test');
done();
self.skip(); // offline - we can not test upload
return;
}
throw err;
throw new Error(errMsg);
});
});

Expand All @@ -69,7 +72,7 @@ describe("Codecov", function(){
if(errCode === 'EAI_AGAIN'){
done();
}
throw err;
throw new Error(errMsg);
}
)).to.not.throwException();
})
Expand Down

0 comments on commit fc1106b

Please sign in to comment.