FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix tests · nodegit/nodegit@93b7587 · GitHub

Repository navigation

Commit 93b7587

Browse files
John Haley
committed
Fix tests
1 parent d1d15ff commit 93b7587

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

‎test/tests/config.js‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ describe("Config", function() {
1616
it("can get and set a global value", function() {
1717
var savedUserName;
1818

19+
function finallyFn() {
20+
return exec("git config --global user.name \"" + savedUserName + "\"");
21+
}
22+
1923
return exec("git config --global user.name")
2024
.then(function(userName) {
2125
savedUserName = userName.trim();
@@ -32,14 +36,18 @@ describe("Config", function() {
3236
.then(function(userNameFromNodeGit) {
3337
assert.equal(savedUserName + "-test", userNameFromNodeGit);
3438
})
35-
.finally(function() {
36-
return exec("git config --global user.name \"" + savedUserName + "\"");
37-
});
39+
.then(finallyFn, finallyFn);
3840
});
3941

4042
it("can get and set a repo config value", function() {
4143
var savedUserName;
4244

45+
function finallyFn() {
46+
return exec("git config user.name \"" + savedUserName + "\"", {
47+
cwd: reposPath
48+
});
49+
}
50+
4351
return exec("git config user.name", {
4452
cwd: reposPath
4553
})
@@ -62,10 +70,6 @@ describe("Config", function() {
6270
.then(function(userNameFromNodeGit) {
6371
assert.equal(savedUserName + "-test", userNameFromNodeGit);
6472
})
65-
.finally(function() {
66-
return exec("git config user.name \"" + savedUserName + "\"", {
67-
cwd: reposPath
68-
});
69-
});
73+
.then(finallyFn, finallyFn);
7074
});
7175
});

‎test/tests/remote.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ describe("Remote", function() {
1515
function removeOrigins(repo) {
1616
return repo.getRemotes()
1717
.then(function(remotes) {
18+
console.log(remotes);
1819
var promises = [];
1920

2021
remotes.forEach(function(remote) {
21-
promises.push(Remote.delete(repo, remote.name()));
22+
if (remote !== "origin") {
23+
promises.push(Remote.delete(repo, remote));
24+
}
2225
});
2326

2427
return Promise.all(promises);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL