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

Commit

Permalink
Add test for CircleCI 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth committed Feb 18, 2017
1 parent 3c36cfa commit 4aaeec3
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion test/services/circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("Circle CI Provider", function(){
expect(circle.detect()).to.be(true);
});

it ("can get circle env info get_commit_status", function(){
it ("can get circle env info (CircleCI 1.0)", function(){
process.env.CIRCLECI = 'true';
process.env.CIRCLE_BUILD_NUM = '1234';
process.env.CIRCLE_SHA1 = '5678';
Expand All @@ -27,4 +27,28 @@ describe("Circle CI Provider", function(){
});
});

it ("can get circle env info (CircleCI 2.0)", function(){
process.env.CIRCLECI = 'true';
process.env.CIRCLE_BRANCH = 'master';
process.env.CIRCLE_BUILD_NUM = '1234';
process.env.CIRCLE_SHA1 = 'abcd';
process.env.CIRCLE_NODE_INDEX = '1';
process.env.CIRCLE_BUILD_URL = 'https://circleci.com/gh/owner/repo/1234';
process.env.CIRCLE_COMPARE_URL = 'https://github.com/owner/repo/2408ca9...3c36cfa';
process.env.CIRCLE_NODE_INDEX = '1';
process.env.CIRCLE_REPOSITORY_URL = 'git@github.com:owner/repo.git';
delete process.env.CIRCLE_PR_NUMBER;
delete process.env.CIRCLE_PROJECT_USERNAME;
delete process.env.CIRCLE_PROJECT_REPONAME;
expect(circle.configuration()).to.eql({
service : 'circleci',
commit : 'abcd',
build : '1234.1',
job : '1234.1',
branch : 'master',
pr : undefined,
slug : 'owner/repo'
});
});

});

0 comments on commit 4aaeec3

Please sign in to comment.