diff options
| author | Nick Merwin <[email protected]> | 2015-07-16 18:22:13 -0700 |
|---|---|---|
| committer | Nick Merwin <[email protected]> | 2015-07-16 18:22:13 -0700 |
| commit | cdff9ff2ad276a33ad8710042d942a8e30e043bb (patch) | |
| tree | 637cf9d9c852cb245519e1048ad331bc33ed2109 /test | |
| parent | 64653c6df1d63065b0fb0b4984ac4c88f809b068 (diff) | |
| parent | 4344c189726451016e86627a0c11620ce420cdaf (diff) | |
| download | node-coveralls-cdff9ff2ad276a33ad8710042d942a8e30e043bb.tar.xz node-coveralls-cdff9ff2ad276a33ad8710042d942a8e30e043bb.zip | |
Merge pull request #101 from ejlangev/support-pull-requests
Pass CI_PULL_REQUEST through to coveralls if it is set
Diffstat (limited to 'test')
| -rw-r--r-- | test/convertLcovToCoveralls.js | 2 | ||||
| -rw-r--r-- | test/getOptions.js | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test/convertLcovToCoveralls.js b/test/convertLcovToCoveralls.js index 6a64eda..24fa6c8 100644 --- a/test/convertLcovToCoveralls.js +++ b/test/convertLcovToCoveralls.js @@ -29,6 +29,7 @@ describe("convertLcovToCoveralls", function(){ process.env.COVERALLS_SERVICE_NAME = "SERVICE_NAME"; process.env.COVERALLS_SERVICE_JOB_ID = "SERVICE_JOB_ID"; process.env.COVERALLS_REPO_TOKEN = "REPO_TOKEN"; + process.env.CI_PULL_REQUEST = "https://github.com/fake/fake/pulls/123"; getOptions(function(err, options){ var lcovpath = __dirname + "/../fixtures/onefile.lcov"; @@ -37,6 +38,7 @@ describe("convertLcovToCoveralls", function(){ options.filepath = libpath; convertLcovToCoveralls(input, options, function(err, output){ should.not.exist(err); + output.service_pull_request.should.equal("123"); //output.git.should.equal("GIT_HASH"); done(); }); diff --git a/test/getOptions.js b/test/getOptions.js index 8a77708..356fb96 100644 --- a/test/getOptions.js +++ b/test/getOptions.js @@ -115,6 +115,9 @@ describe("getOptions", function(){ it ("should set service_name if it exists", function(done){ testServiceName(getOptions, done); }); + it("should set service_pull_request if it exists", function(done){ + testServicePullRequest(getOptions, done); + }); it ("should set service_name and service_job_id if it's running on travis-ci", function(done){ testTravisCi(getOptions, done); }); @@ -246,6 +249,14 @@ var testServiceName = function(sut, done){ }); }; +var testServicePullRequest = function(sut, done){ + process.env.CI_PULL_REQUEST = "https://github.com/fake/fake/pulls/123"; + sut(function(err, options){ + options.service_pull_request.should.equal("123"); + done(); + }); +}; + var testTravisCi = function(sut, done){ process.env.TRAVIS = "TRUE"; process.env.TRAVIS_JOB_ID = "1234"; |
