diff options
| author | Manu Phatak <[email protected]> | 2018-05-01 15:51:15 -0500 |
|---|---|---|
| committer | Nick Merwin <[email protected]> | 2018-05-01 13:51:15 -0700 |
| commit | bd667c617bbf5ff921f6b3734a991cde874db320 (patch) | |
| tree | 9b1737c0d39ca30bfc2456707b79b1a0c8c9dce5 /test/getOptions.js | |
| parent | 10d8b3ea5e15419500d717638469e95f0f2d29cc (diff) | |
| download | node-coveralls-bd667c617bbf5ff921f6b3734a991cde874db320.tar.xz node-coveralls-bd667c617bbf5ff921f6b3734a991cde874db320.zip | |
Add Semaphore support (#180)
Semaphore ENV variables: https://semaphoreci.com/docs/available-environment-variables.html
Diffstat (limited to 'test/getOptions.js')
| -rw-r--r-- | test/getOptions.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/getOptions.js b/test/getOptions.js index 51e4fa0..6e8d898 100644 --- a/test/getOptions.js +++ b/test/getOptions.js @@ -143,6 +143,9 @@ describe("getOptions", function(){ it ("should set service_name and service_job_id if it's running via Surf", function(done){ testSurf(getOptions, done); }); + it ("should set service_name and service_job_id if it's running via Semaphore", function(done){ + testSemaphore(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"; @@ -446,6 +449,28 @@ var testSurf = function(sut, done) { }); }; +var testSemaphore = function(sut, done) { + process.env.SEMAPHORE = true; + process.env.SEMAPHORE_BUILD_NUMBER = '1234'; + process.env.REVISION = "e3e3e3e3e3e3e3e3e"; + process.env.BRANCH_NAME = "master"; + + sut(function(err, options){ + options.service_name.should.equal("semaphore"); + 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', + remotes: [] }); + done(); + }); +}; + function ensureLocalGitContext(options) { var path = require('path'); |
