diff options
| author | Gabe Hayes <[email protected]> | 2013-07-29 14:04:09 -0700 |
|---|---|---|
| committer | Gabe Hayes <[email protected]> | 2013-07-29 14:04:09 -0700 |
| commit | 22a68e0584689b6fbd98fcb5ef993dca5354f122 (patch) | |
| tree | dc0ac037e85c1de20c9d53f056bf6363aeedbadc /test/fetchGitData.js | |
| parent | ecb13e11c3d7dd29552e5872329d8d0ea4a18fde (diff) | |
| download | node-coveralls-22a68e0584689b6fbd98fcb5ef993dca5354f122.tar.xz node-coveralls-22a68e0584689b6fbd98fcb5ef993dca5354f122.zip | |
use getOptions method to fetch commit data
Diffstat (limited to 'test/fetchGitData.js')
| -rw-r--r-- | test/fetchGitData.js | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/test/fetchGitData.js b/test/fetchGitData.js index c8ddbc5..8e1c7a9 100644 --- a/test/fetchGitData.js +++ b/test/fetchGitData.js @@ -1,5 +1,6 @@ var should = require('should'); var git = require('../lib/fetchGitData'); +var getOptions = require('../index').getOptions; describe("fetchGitData", function(){ beforeEach(function(){ @@ -144,11 +145,9 @@ describe("fetchGitData", function(){ }); }); it("should execute git commands when a valid commit hash is given", function() { - var options = git({ - "head": { - "id": "5eaec7e76af0743f9764e617472ef434f283a195" - } - }); + process.env.COVERALLS_GIT_COMMIT = "5eaec7e76af0743f9764e617472ef434f283a195"; + process.env.COVERALLS_GIT_BRANCH = "master"; + var options = getOptions().git; options.head.should.eql({ "id": "5eaec7e76af0743f9764e617472ef434f283a195", "author_name": "cainus", @@ -162,30 +161,4 @@ describe("fetchGitData", function(){ options.remotes.should.be.instanceof(Array); options.remotes.length.should.be.above(0); }); - it("should combine passed remotes with git remotes when a valid commit hash is given", function() { - var options = git({ - "head": { - "id": "5eaec7e76af0743f9764e617472ef434f283a195" - }, - "remotes": [ - { - "name": "test", - "url": "https://my.test.url" - } - ] - }); - options.head.should.eql({ - "id": "5eaec7e76af0743f9764e617472ef434f283a195", - "author_name": "cainus", - "author_email": "[email protected]", - "committer_name": "cainus", - "committer_email": "[email protected]", - "message": "first commit" - }); - options.branch.should.equal("master"); - options.remotes.should.includeEql({ - "name": "test", - "url": "https://my.test.url" - }); - }); }); |
