Skip to content

Commit cabadca

Browse files
committed
Added commit.file tests
1 parent 424cd4f commit cabadca

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/convenience-commit.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,19 @@ exports.parentsDiffTrees = function(test) {
170170
});
171171
});
172172
};
173+
174+
exports.file = function(test) {
175+
test.expect(5);
176+
git.repo('../.git', function(error, repository) {
177+
repository.commit(historyCountKnownSHA, function(error, commit) {
178+
commit.file('README.md', function(error, file) {
179+
test.equal(error, null, 'Should not error');
180+
test.notEqual(file, null, 'File should not be null');
181+
test.equal(file.name, 'README.md', 'File name should match expected');
182+
test.equal(file.sha, 'b252f396b17661462372f78b7bcfc403b8731aaa', 'SHA shoud match expected');
183+
test.equal(file.attributes, 33188, 'Attributes should match expected');
184+
test.done();
185+
});
186+
});
187+
});
188+
};

0 commit comments

Comments
 (0)