aboutsummaryrefslogtreecommitdiff
path: root/test/getOptions.js
diff options
context:
space:
mode:
authorGabe Hayes <[email protected]>2013-07-25 13:33:26 -0700
committerGabe Hayes <[email protected]>2013-07-25 13:33:26 -0700
commita3436f94ab8adf8075898ca63f11ff328cd054d4 (patch)
treec6ddcefed413fc0a0e4327edb2fbc3edefc339ee /test/getOptions.js
parent186ee258ee7bfa94cacef73dd36a79db35100bfe (diff)
downloadnode-coveralls-a3436f94ab8adf8075898ca63f11ff328cd054d4.tar.xz
node-coveralls-a3436f94ab8adf8075898ca63f11ff328cd054d4.zip
add tests for circleci integration
Diffstat (limited to 'test/getOptions.js')
-rw-r--r--test/getOptions.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/test/getOptions.js b/test/getOptions.js
index 5c20c5c..501eb51 100644
--- a/test/getOptions.js
+++ b/test/getOptions.js
@@ -8,7 +8,7 @@ describe("getOptions", function(){
it ("should get a filepath if there is one", function(){
process.argv[2] = "somepath";
getOptions().filepath.should.equal("somepath");
-
+
});
it ("should get a filepath if there is one, even in verbose mode", function(){
process.argv[2] = "--verbose";
@@ -59,5 +59,21 @@ describe("getOptions", function(){
message: 'Unknown Commit Message' },
branch: 'master' });
});
-
+ it ("should set service_name and service_job_id if it's running on circleci", function(){
+ process.env.CIRCLECI = true;
+ process.env.CIRCLE_BRANCH = "master";
+ process.env.CIRCLE_BUILD_NUM = "1234";
+ process.env.CIRCLE_SHA1 = "e3e3e3e3e3e3e3e3e";
+ var options = getOptions();
+ options.service_name.should.equal("circleci");
+ options.service_job_id.should.equal("1234");
+ options.git.should.eql({ head:
+ { id: 'e3e3e3e3e3e3e3e3e',
+ author_name: 'Unknown Author',
+ author_email: '',
+ committer_name: 'Unknown Committer',
+ committer_email: '',
+ message: 'Unknown Commit Message' },
+ branch: 'master' });
+ });
});