diff --git a/lib/getOptions.js b/lib/getOptions.js index d30020fc..0c2c7dc3 100644 --- a/lib/getOptions.js +++ b/lib/getOptions.js @@ -152,6 +152,10 @@ var getBaseOptions = function(cb){ } } + if (process.env.COVERALLS_FLAG_NAME) { + options.flag_name = process.env.COVERALLS_FLAG_NAME; + } + if (git_commit){ fetchGitData({ head: { diff --git a/test/getOptions.js b/test/getOptions.js index dd70a9b6..d73b79c7 100644 --- a/test/getOptions.js +++ b/test/getOptions.js @@ -116,6 +116,9 @@ describe("getOptions", function(){ it ("should set paralell if env var set", function(done){ testParallel(getOptions, done); }); + it ("should set flag_name if it exists", function(done) { + testFlagName(getOptions, done); + }); it ("should set service_name if it exists", function(done){ testServiceName(getOptions, done); }); @@ -242,6 +245,15 @@ var testParallel = function(sut, done){ }); }; +var testFlagName = function(sut, done){ + process.env.COVERALLS_FLAG_NAME = 'test flag'; + + sut(function(err, options){ + options.flag_name.should.equal('test flag'); + done(); + }); +}; + var testRepoTokenDetection = function(sut, done) { var fs = require('fs'); var path = require('path');