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

Commit

Permalink
added test for runtime exception when offline
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnetCarpenter committed Aug 31, 2016
1 parent 6f21a16 commit 3eb26c1
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions test/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ describe("Codecov", function(){
expect(body).to.contain('http://codecov.io/github/codecov/ci-repo/commit/c739768fcac68144a3a6d82305b9c4106934d31a');
done();
},
function(err){
function(errCode, errMsg){
if(errCode === 'EAI_AGAIN'){
console.log('Offline - can not run this test');
done();
}
throw err;
});
});
Expand All @@ -39,9 +43,35 @@ describe("Codecov", function(){
expect(body).to.contain('http://codecov.io/github/codecov/ci-repo/commit/c739768fcac68144a3a6d82305b9c4106934d31a');
done();
},
function(err){
function(errCode, errMsg){
if(errCode === 'EAI_AGAIN'){
console.log('Offline - can not run this test');
done();
}
throw err;
});
});

it("upload v2 doesn't throw runtime error", function(done){
expect(codecov.sendToCodecovV2.bind(null,
'https://codecov.io',
{
token: 'f881216b-b5c0-4eb1-8f21-b51887d1d506',
commit: 'c739768fcac68144a3a6d82305b9c4106934d31a',
branch: 'master'
},
'testing node-'+codecov.version,
function(body){
expect(body).to.contain('http://codecov.io/github/codecov/ci-repo/commit/c739768fcac68144a3a6d82305b9c4106934d31a');
done();
},
function(errCode, errMsg){
if(errCode === 'EAI_AGAIN'){
done();
}
throw err;
}
)).to.not.throwException();
})

});

0 comments on commit 3eb26c1

Please sign in to comment.