Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
zawata committed Mar 24, 2022
commit f19d402733d33dc3eb2d1f151d4275d0a23c39be
52 changes: 0 additions & 52 deletions test/tests/clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ describe("Clone", function() {
this.timeout(30000);

beforeEach(function() {
if (process.platform === "win32") {
NodeGit.Libgit2.opts(NodeGit.Libgit2.OPT.SET_WINDOWS_LONGPATHS, 0);
}

return fse.remove(clonePath)
.then(function() {
return fse.remove(longClonePath);
Expand Down Expand Up @@ -84,54 +80,6 @@ describe("Clone", function() {
});
});

it("can clone into long path if opt set", function() {
var test = this;
var url = "https://github.com/nodegit/test.git";
var opts = {
fetchOpts: {
callbacks: {
certificateCheck: () => 0
}
}
};

fse.ensureDirSync(longClonePath);

if (process.platform === "win32") {
NodeGit.Libgit2.opts(NodeGit.Libgit2.OPT.SET_WINDOWS_LONGPATHS, 1);
Comment thread
ianhattendorf marked this conversation as resolved.
}

return Clone(url, longClonePath, opts).then(function(repo) {
assert.ok(repo instanceof Repository);
test.repository = repo;
});
});

it("can't clone into long path if opt not set on win32", function() {
if (process.platform !== "win32") {
this.skip();
}

var url = "https://github.com/nodegit/test.git";
var opts = {
fetchOpts: {
callbacks: {
certificateCheck: () => 0
}
}
};

fse.ensureDirSync(longClonePath);

NodeGit.Libgit2.opts(NodeGit.Libgit2.OPT.SET_WINDOWS_LONGPATHS, 0);

return Clone(url, longClonePath, opts).then(function(repo) {
assert.fail("Clone should not succeed");
}).catch(function(error) {
assert.ok(error instanceof Error);
});
});

it("can clone twice with https using same config object", function() {
var test = this;
var url = "https://github.com/nodegit/test.git";
Expand Down
2 changes: 1 addition & 1 deletion test/tests/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ describe("Filter", function() {

it("should apply filter when check succeeds", function() {
var test = this;
var applied = true;
var applied = false;

return Registry.register(filterName, {
apply: function() {
Expand Down
1 change: 1 addition & 0 deletions test/tests/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ describe("Graph", function() {
)
.catch(function(result) {
assert(~result.message.indexOf("81b06fac"));
assert(~result.message.indexOf("object not found - no match for id"));
});
});
});
15 changes: 8 additions & 7 deletions test/tests/rebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,7 @@ describe("Rebase", function() {
})
.then(function(commitOid) {
assert.equal(commitOid.toString(),
"24250fe6bd8a782ec1aaca8b2c9a2456a90517ed");
"617cd03370dd799f372e9dcfcd0b097aede1bd7f");

// git_rebase_operation_current returns the index of the rebase
// operation that was last applied, so after the first operation, it
Expand All @@ -1891,13 +1891,13 @@ describe("Rebase", function() {
.then(function(commit) {
// verify that the "ours" branch has moved to the correct place
assert.equal(commit.id().toString(),
"24250fe6bd8a782ec1aaca8b2c9a2456a90517ed");
"617cd03370dd799f372e9dcfcd0b097aede1bd7f");
Comment thread
ianhattendorf marked this conversation as resolved.

return Promise.all([
commit.parent(0),
NodeGit.Commit.extractSignature(
repository,
"24250fe6bd8a782ec1aaca8b2c9a2456a90517ed",
"617cd03370dd799f372e9dcfcd0b097aede1bd7f",
"moose-sig"
)
]);
Expand Down Expand Up @@ -2416,7 +2416,7 @@ describe("Rebase", function() {
});
});


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

let rebase;
let newCommitOid;

const rebaseOptions = {
signingCb: () => ({
code: NodeGit.Error.CODE.OK,
field: "moose-sig",
signedData: "A moose was here."
})
};

const repository = this.repository;

// Create two commits on master
Expand Down Expand Up @@ -2521,13 +2521,14 @@ describe("Rebase", function() {
.then((_newCommitOid) => {
newCommitOid = _newCommitOid;
assert.strictEqual(newCommitOid.toString(),
"89ad8168264267bcc50ee60ade3bc3804f55aa72");
"9909e435b52322a71dc341d747b29c392a34c745");
return rebase.next();
})
.then(() => {
assert.fail("should throw");
})
.catch((error) => {
console.log(error);
Comment thread
ianhattendorf marked this conversation as resolved.
Outdated
assert(error.errno === NodeGit.Error.CODE.ITEROVER);
assert.strictEqual(rebase.finish(ourSignature), 0);
return NodeGit.Commit.extractSignature(
Expand Down