aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/fetchGitData.js35
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"
- });
- });
});