Skip to content

Commit 650019f

Browse files
committed
Added commit date tests
1 parent 6f491b1 commit 650019f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/convenience-commit.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,21 @@ exports.time = function(test) {
7676
});
7777
};
7878

79+
exports.date = function(test) {
80+
test.expect(4);
81+
git.repo('../.git', function(error, repository) {
82+
repository.commit(historyCountKnownSHA, function(error, commit) {
83+
commit.date(function(error, date) {
84+
test.equals(error, null, 'There should be no error');
85+
test.notEqual(date, null, 'Date should not be null');
86+
test.equal(date instanceof Date, true, 'Date should be a date object');
87+
test.equals(date.getTime(), 1362012884000, 'Date should match expected value');
88+
test.done();
89+
});
90+
});
91+
});
92+
};
93+
7994
exports.offset = function(test) {
8095
test.expect(3);
8196
git.repo('../.git', function(error, repository) {

0 commit comments

Comments
 (0)