diff options
| author | Dylan Smith <[email protected]> | 2019-06-05 18:52:14 -0500 |
|---|---|---|
| committer | Nick Merwin <[email protected]> | 2019-06-05 16:52:14 -0700 |
| commit | f0ddec529c8271ea193bfab41de12b6c06d533f5 (patch) | |
| tree | 0a66ae2e2ddb0a89fc173369c8040ffefd69b80a /test/getOptions.js | |
| parent | 8ac43255d55eb28b25204480492d0c405eaa129c (diff) | |
| download | node-coveralls-f0ddec529c8271ea193bfab41de12b6c06d533f5.tar.xz node-coveralls-f0ddec529c8271ea193bfab41de12b6c06d533f5.zip | |
Add support for Azure Pipelines (#221)
Diffstat (limited to 'test/getOptions.js')
| -rw-r--r-- | test/getOptions.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/getOptions.js b/test/getOptions.js index d73b79c..e477e61 100644 --- a/test/getOptions.js +++ b/test/getOptions.js @@ -58,6 +58,9 @@ describe("getBaseOptions", function(){ it ("should set service_name and service_job_id if it's running on Buildkite", function(done){ testBuildkite(getBaseOptions, done); }); + it ("should set service_name and service_job_id if it's running on Azure Pipelines", function(done){ + testAzurePipelines(getBaseOptions, done); + }); }); describe("getOptions", function(){ @@ -155,6 +158,9 @@ describe("getOptions", function(){ it ("should set service_name and service_job_id if it's running via Semaphore", function(done){ testSemaphore(getOptions, done); }); + it ("should set service_name and service_job_id if it's running via Azure Pipelines", function(done){ + testAzurePipelines(getOptions, done); + }); it ("should override set options with user options", function(done){ var userOptions = {service_name: 'OVERRIDDEN_SERVICE_NAME'}; process.env.COVERALLS_SERVICE_NAME = "SERVICE_NAME"; @@ -512,6 +518,32 @@ var testSemaphore = function(sut, done) { }); }; +var testAzurePipelines = function(sut, done){ + process.env.TF_BUILD = "true"; + process.env.BUILD_SOURCEBRANCHNAME = "hotfix"; + process.env.BUILD_SOURCEVERSION = "e3e3e3e3e3e3e3e3e"; + process.env.BUILD_BUILDID = "1234"; + process.env.SYSTEM_PULLREQUEST_PULLREQUESTNUMBER = "123"; + + sut(function(err, options){ + options.service_name.should.equal("Azure Pipelines"); + options.service_job_id.should.equal("1234"); + options.service_pull_request.should.equal("123"); + + options.git.should.eql({ head: + { id: 'e3e3e3e3e3e3e3e3e', + author_name: 'Unknown Author', + author_email: '', + committer_name: 'Unknown Committer', + committer_email: '', + message: 'Unknown Commit Message' }, + branch: 'hotfix', + remotes: [] }); + + done(); + }); +}; + function ensureLocalGitContext(options) { var path = require('path'); |
