Skip to content

Commit

Permalink
Merge branch 'appveyor-tests' of https://github.com/XhmikosR/node-cov…
Browse files Browse the repository at this point in the history
…eralls into XhmikosR-appveyor-tests
  • Loading branch information
nickmerwin committed Nov 21, 2019
2 parents 51890f8 + 150e39b commit ba49b6d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/getOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ describe('getOptions', () => {
it('should set service_name and service_job_id if it\'s running on Gitlab', done => {
testGitlab(getOptions, done);
});
it ("should set service_name and service_job_id if it's running on AppVeyor", done => {
testAppVeyor(getOptions, done);
});
it('should set service_name and service_job_id if it\'s running via Surf', done => {
testSurf(getOptions, done);
});
Expand Down Expand Up @@ -524,6 +527,30 @@ const testGitlab = (sut, done) => {
});
};

const testAppVeyor = function(sut, done) {
process.env.APPVEYOR = true;
process.env.APPVEYOR_BUILD_ID = "1234";
process.env.APPVEYOR_BUILD_NUMBER = "5678";
process.env.APPVEYOR_REPO_COMMIT = "e3e3e3e3e3e3e3e3e";
process.env.APPVEYOR_REPO_BRANCH = "feature";

sut(function(err, options){
options.service_name.should.equal("appveyor");
options.service_job_id.should.equal("1234");
options.service_job_number.should.equal("5678");
options.git.should.eql({ head:
{ id: 'e3e3e3e3e3e3e3e3e',
author_name: 'Unknown Author',
author_email: '',
committer_name: 'Unknown Committer',
committer_email: '',
message: 'Unknown Commit Message' },
branch: 'feature',
remotes: [] });
done();
});
};

const testSurf = (sut, done) => {
process.env.CI_NAME = 'surf';
process.env.SURF_SHA1 = 'e3e3e3e3e3e3e3e3e';
Expand Down

0 comments on commit ba49b6d

Please sign in to comment.