[Pkg-javascript-commits] [node-coveralls] 79/332: use getOptions method to fetch commit data

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 13:53:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-coveralls.

commit 22a68e0584689b6fbd98fcb5ef993dca5354f122
Author: Gabe Hayes <gabriel.hayes at gmail.com>
Date:   Mon Jul 29 14:04:09 2013 -0700

    use getOptions method to fetch commit data
---
 test/fetchGitData.js | 35 ++++-------------------------------
 1 file 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": "gregg at caines.ca",
-      "committer_name": "cainus",
-      "committer_email": "gregg at caines.ca",
-      "message": "first commit"
-    });
-    options.branch.should.equal("master");
-    options.remotes.should.includeEql({
-      "name": "test",
-      "url": "https://my.test.url"
-    });
-  });
 });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-coveralls.git



More information about the Pkg-javascript-commits mailing list