aboutsummaryrefslogtreecommitdiff
path: root/test/getOptions.js
diff options
context:
space:
mode:
authorcainus <[email protected]>2013-06-22 14:39:16 -0700
committercainus <[email protected]>2013-06-22 14:39:16 -0700
commit311cdeedb62363ec047f0cfe8f1d9460a9735c3a (patch)
tree061d9cc2b807a6972532c78b5f9b5f501236ab10 /test/getOptions.js
parent82cf2e8e13f84d6efb34c70db5a9673ec4dd100e (diff)
downloadnode-coveralls-311cdeedb62363ec047f0cfe8f1d9460a9735c3a.tar.xz
node-coveralls-311cdeedb62363ec047f0cfe8f1d9460a9735c3a.zip
improved testing.
Diffstat (limited to 'test/getOptions.js')
-rw-r--r--test/getOptions.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/getOptions.js b/test/getOptions.js
index e8e3c7a..c1c2133 100644
--- a/test/getOptions.js
+++ b/test/getOptions.js
@@ -2,6 +2,9 @@ var should = require('should');
var getOptions = require('../index').getOptions;
describe("getOptions", function(){
+ beforeEach(function(){
+ process.env = {};
+ });
it ("should get a filepath if there is one", function(){
process.argv[2] = "somepath";
getOptions().filepath.should.equal("somepath");
@@ -11,7 +14,28 @@ describe("getOptions", function(){
process.argv[2] = "--verbose";
process.argv[3] = "somepath";
getOptions().filepath.should.equal("somepath");
-
+ });
+ it ("should set service_job_id if it exists", function(){
+ process.env.COVERALLS_SERVICE_JOB_ID = "SERVICE_JOB_ID";
+ getOptions().service_job_id.should.equal("SERVICE_JOB_ID");
+ });
+ it ("should set git if it exists", function(){
+ process.env.COVERALLS_GIT = "qwer";
+ getOptions().git.should.equal("qwer");
+ });
+ it ("should set repo_token if it exists", function(){
+ process.env.COVERALLS_REPO_TOKEN = "REPO_TOKEN";
+ getOptions().repo_token.should.equal("REPO_TOKEN");
+ });
+ it ("should set service_name if it exists", function(){
+ process.env.COVERALLS_SERVICE_NAME = "SERVICE_NAME";
+ getOptions().service_name.should.equal("SERVICE_NAME");
+ });
+ it ("should set service_name and service_job_id if it's running on travis-ci", function(){
+ process.env.TRAVIS = "TRUE";
+ process.env.TRAVIS_JOB_ID = "1234";
+ getOptions().service_name.should.equal("travis-ci");
+ getOptions().service_job_id.should.equal("1234");
});
});