[Pkg-javascript-commits] [node-coveralls] 85/332: fixed git test

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 11f429f64c225a3e933458aff5b4e500f274455b
Author: Gabe Hayes <gabriel.hayes at gmail.com>
Date:   Tue Jul 30 10:17:21 2013 -0700

    fixed git test
---
 lib/fetchGitData.js  | 11 +----------
 test/fetchGitData.js | 19 +++++++++----------
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/lib/fetchGitData.js b/lib/fetchGitData.js
index d663716..629d650 100644
--- a/lib/fetchGitData.js
+++ b/lib/fetchGitData.js
@@ -75,7 +75,6 @@ var fetchGitData = function(git) {
     exec("git log -1 " + git.head.id + " --pretty=format:'%H'");
   } catch (e) {
     execGit = false;
-    logger.warn("unable to execute git, using default/passed values instead.", e.message);
   }
 
   //-- Head
@@ -92,16 +91,8 @@ var fetchGitData = function(git) {
   if (execGit) {
 
     //-- Branch
-    if ("" === git.branch) {
-      git.branch = exec("git branch").split("\n")[0].replace(/^\*\ /, "").trim();
-    }
+    git.branch = exec("git branch").split("\n")[0].replace(/^\*\ /, "").trim();
 
-    //-- Remotes
-    if (0 !== git.remotes.length) {
-      for (i in git.remotes) {
-        saveRemote(git.remotes[i].name, git.remotes[i].url, false);
-      }
-    }
     exec("git remote -v").split("\n").forEach(function(remote) {
       remote = remote.split(/\s/);
       saveRemote(remote[0], remote[1]);
diff --git a/test/fetchGitData.js b/test/fetchGitData.js
index 80c116f..a036e50 100644
--- a/test/fetchGitData.js
+++ b/test/fetchGitData.js
@@ -144,21 +144,20 @@ describe("fetchGitData", function(){
       ]
     });
   });
-  xit("should execute git commands when a valid commit hash is given", function() {
-    process.env.COVERALLS_GIT_COMMIT = "5eaec7e76af0743f9764e617472ef434f283a195";
+  it("should execute git commands when a valid commit hash is given", function() {
+    process.env.COVERALLS_GIT_COMMIT = "HEAD";
     process.env.COVERALLS_GIT_BRANCH = "master";
     var options = getOptions().git;
-    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.head.should.be.a("object");
+    options.head.author_name.should.not.equal("Unknown Author");
+    options.head.committer_name.should.not.equal("Unknown Committer");
+    options.head.message.should.not.equal("Unknown Commit Message");
     options.branch.should.equal("master");
     options.should.have.property("remotes");
     options.remotes.should.be.instanceof(Array);
     options.remotes.length.should.be.above(0);
   });
+  it("should join passed remotes when a valid commit hash is given", function() {
+
+  });
 });

-- 
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