Skip to content

Commit

Permalink
Merge branch 'XhmikosR-appveyor-tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmerwin committed Nov 21, 2019
2 parents 51890f8 + ba49b6d commit 7c6178f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/getOptions.js
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 7c6178f

Please sign in to comment.