Commit 88d70747 authored by Remy Suen's avatar Remy Suen

Add tests for AnnotatedCommit

fromFetchhead
fromRevspec
parent 4611ca75
...@@ -67,4 +67,27 @@ describe("AnnotatedCommit", function() { ...@@ -67,4 +67,27 @@ describe("AnnotatedCommit", function() {
assert(id, annotatedCommit.id()); assert(id, annotatedCommit.id());
}); });
}); });
it("can lookup an AnnotatedCommit from a revspec", function() {
var test = this;
return AnnotatedCommit.fromRevspec(test.repository, "checkout-test")
.then(function(annotatedCommit) {
assert.equal(annotatedCommit.id().toString(),
"1729c73906bb8467f4095c2f4044083016b4dfde");
});
});
it("can lookup an AnnotatedCommit from a fetchhead", function() {
var test = this;
return AnnotatedCommit.fromFetchhead(test.repository,
"rev-walk",
"https://github.com/nodegit/test",
"32789a79e71fbc9e04d3eff7425e1771eb595150")
.then(function(annotatedCommit) {
assert.equal(annotatedCommit.id().toString(),
"32789a79e71fbc9e04d3eff7425e1771eb595150");
});
});
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment