Skip to content

Commit f19d402

Browse files
committed
fix tests
1 parent a2897b9 commit f19d402

4 files changed

Lines changed: 10 additions & 60 deletions

File tree

test/tests/clone.js

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ describe("Clone", function() {
4343
this.timeout(30000);
4444

4545
beforeEach(function() {
46-
if (process.platform === "win32") {
47-
NodeGit.Libgit2.opts(NodeGit.Libgit2.OPT.SET_WINDOWS_LONGPATHS, 0);
48-
}
49-
5046
return fse.remove(clonePath)
5147
.then(function() {
5248
return fse.remove(longClonePath);
@@ -84,54 +80,6 @@ describe("Clone", function() {
8480
});
8581
});
8682

87-
it("can clone into long path if opt set", function() {
88-
var test = this;
89-
var url = "https://github.com/nodegit/test.git";
90-
var opts = {
91-
fetchOpts: {
92-
callbacks: {
93-
certificateCheck: () => 0
94-
}
95-
}
96-
};
97-
98-
fse.ensureDirSync(longClonePath);
99-
100-
if (process.platform === "win32") {
101-
NodeGit.Libgit2.opts(NodeGit.Libgit2.OPT.SET_WINDOWS_LONGPATHS, 1);
102-
}
103-
104-
return Clone(url, longClonePath, opts).then(function(repo) {
105-
assert.ok(repo instanceof Repository);
106-
test.repository = repo;
107-
});
108-
});
109-
110-
it("can't clone into long path if opt not set on win32", function() {
111-
if (process.platform !== "win32") {
112-
this.skip();
113-
}
114-
115-
var url = "https://github.com/nodegit/test.git";
116-
var opts = {
117-
fetchOpts: {
118-
callbacks: {
119-
certificateCheck: () => 0
120-
}
121-
}
122-
};
123-
124-
fse.ensureDirSync(longClonePath);
125-
126-
NodeGit.Libgit2.opts(NodeGit.Libgit2.OPT.SET_WINDOWS_LONGPATHS, 0);
127-
128-
return Clone(url, longClonePath, opts).then(function(repo) {
129-
assert.fail("Clone should not succeed");
130-
}).catch(function(error) {
131-
assert.ok(error instanceof Error);
132-
});
133-
});
134-
13583
it("can clone twice with https using same config object", function() {
13684
var test = this;
13785
var url = "https://github.com/nodegit/test.git";

test/tests/filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ describe("Filter", function() {
220220

221221
it("should apply filter when check succeeds", function() {
222222
var test = this;
223-
var applied = true;
223+
var applied = false;
224224

225225
return Registry.register(filterName, {
226226
apply: function() {

test/tests/graph.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ describe("Graph", function() {
5959
)
6060
.catch(function(result) {
6161
assert(~result.message.indexOf("81b06fac"));
62+
assert(~result.message.indexOf("object not found - no match for id"));
6263
});
6364
});
6465
});

test/tests/rebase.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,7 @@ describe("Rebase", function() {
18741874
})
18751875
.then(function(commitOid) {
18761876
assert.equal(commitOid.toString(),
1877-
"24250fe6bd8a782ec1aaca8b2c9a2456a90517ed");
1877+
"617cd03370dd799f372e9dcfcd0b097aede1bd7f");
18781878

18791879
// git_rebase_operation_current returns the index of the rebase
18801880
// operation that was last applied, so after the first operation, it
@@ -1891,13 +1891,13 @@ describe("Rebase", function() {
18911891
.then(function(commit) {
18921892
// verify that the "ours" branch has moved to the correct place
18931893
assert.equal(commit.id().toString(),
1894-
"24250fe6bd8a782ec1aaca8b2c9a2456a90517ed");
1894+
"617cd03370dd799f372e9dcfcd0b097aede1bd7f");
18951895

18961896
return Promise.all([
18971897
commit.parent(0),
18981898
NodeGit.Commit.extractSignature(
18991899
repository,
1900-
"24250fe6bd8a782ec1aaca8b2c9a2456a90517ed",
1900+
"617cd03370dd799f372e9dcfcd0b097aede1bd7f",
19011901
"moose-sig"
19021902
)
19031903
]);
@@ -2416,7 +2416,7 @@ describe("Rebase", function() {
24162416
});
24172417
});
24182418

2419-
2419+
24202420
it("rebase signs correctly if rebaseOptions are re-used", function () {
24212421
const ourFileName = "ourNewFile.txt";
24222422
const theirFileName = "theirNewFile.txt";
@@ -2434,15 +2434,15 @@ describe("Rebase", function() {
24342434

24352435
let rebase;
24362436
let newCommitOid;
2437-
2437+
24382438
const rebaseOptions = {
24392439
signingCb: () => ({
24402440
code: NodeGit.Error.CODE.OK,
24412441
field: "moose-sig",
24422442
signedData: "A moose was here."
24432443
})
24442444
};
2445-
2445+
24462446
const repository = this.repository;
24472447

24482448
// Create two commits on master
@@ -2521,13 +2521,14 @@ describe("Rebase", function() {
25212521
.then((_newCommitOid) => {
25222522
newCommitOid = _newCommitOid;
25232523
assert.strictEqual(newCommitOid.toString(),
2524-
"89ad8168264267bcc50ee60ade3bc3804f55aa72");
2524+
"9909e435b52322a71dc341d747b29c392a34c745");
25252525
return rebase.next();
25262526
})
25272527
.then(() => {
25282528
assert.fail("should throw");
25292529
})
25302530
.catch((error) => {
2531+
console.log(error);
25312532
assert(error.errno === NodeGit.Error.CODE.ITEROVER);
25322533
assert.strictEqual(rebase.finish(ourSignature), 0);
25332534
return NodeGit.Commit.extractSignature(

0 commit comments

Comments
 (0)