diff options
| author | Gerard Escalante <[email protected]> | 2014-02-11 13:16:07 +0900 |
|---|---|---|
| committer | Gerard Escalante <[email protected]> | 2014-02-11 13:16:07 +0900 |
| commit | 2275311f3a1b9125993686161d76aa54e087705b (patch) | |
| tree | b5dd382eca6085a8ca8ba3beabf5d4c56f0b3df6 /test/getOptions.js | |
| parent | a62635d49b7eb864e64258c5d65b47ad03195fa2 (diff) | |
| download | node-coveralls-2275311f3a1b9125993686161d76aa54e087705b.tar.xz node-coveralls-2275311f3a1b9125993686161d76aa54e087705b.zip | |
Read service_name from coveralls.yml
Also fixed a typo from the last commit.
Diffstat (limited to 'test/getOptions.js')
| -rw-r--r-- | test/getOptions.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/getOptions.js b/test/getOptions.js index 2fc7be0..fc33012 100644 --- a/test/getOptions.js +++ b/test/getOptions.js @@ -197,17 +197,25 @@ var testRepoTokenDetection = function(sut, done) { var fs = require('fs'); var path = require('path'); - var file = path.join(process.cwd(), '.coveralls.yml'), token, synthetic = false; + var file = path.join(process.cwd(), '.coveralls.yml'), token, service_name, synthetic = false; if (fs.exists(file)) { var yaml = require('js-yaml'); - token = yaml.saveLoad(fs.readFileSync(yml, 'utf8')).repo_token; + var coveralls_yml_doc = yaml.safeLoad(fs.readFileSync(yml, 'utf8')); + token = coveralls_yml_doc.repo_token; + if(coveralls_yml_doc.service_name) { + service_name = coveralls_yml_doc.service_name; + } } else { token = 'REPO_TOKEN'; - fs.writeFileSync(file, 'repo_token: ' + token); + service_name = 'travis-pro'; + fs.writeFileSync(file, 'repo_token: ' + token+'\nservice_name: ' + service_name); synthetic = true; } sut(function(err, options) { options.repo_token.should.equal(token); + if(service_name) { + options.service_name.should.equal(service_name); + } if (synthetic) fs.unlink(file); done(); |
