Skip to content

Commit c606dd9

Browse files
committed
fix git tests
1 parent d60bf23 commit c606dd9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

extensions/git/src/test/git.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,42 +189,54 @@ suite('git', () => {
189189
suite('parseGitCommit', () => {
190190
test('single parent commit', function () {
191191
const GIT_OUTPUT_SINGLE_PARENT = `52c293a05038d865604c2284aa8698bd087915a1
192+
John Doe
192193
john.doe@mail.com
194+
1580811030
193195
8e5a374372b8393906c7e380dbb09349c5385554
194196
This is a commit message.\x00`;
195197

196198
assert.deepEqual(parseGitCommits(GIT_OUTPUT_SINGLE_PARENT), [{
197199
hash: '52c293a05038d865604c2284aa8698bd087915a1',
198200
message: 'This is a commit message.',
199201
parents: ['8e5a374372b8393906c7e380dbb09349c5385554'],
202+
authorDate: new Date(1580811030000),
203+
authorName: 'John Doe',
200204
authorEmail: 'john.doe@mail.com',
201205
}]);
202206
});
203207

204208
test('multiple parent commits', function () {
205209
const GIT_OUTPUT_MULTIPLE_PARENTS = `52c293a05038d865604c2284aa8698bd087915a1
210+
John Doe
206211
john.doe@mail.com
212+
1580811030
207213
8e5a374372b8393906c7e380dbb09349c5385554 df27d8c75b129ab9b178b386077da2822101b217
208214
This is a commit message.\x00`;
209215

210216
assert.deepEqual(parseGitCommits(GIT_OUTPUT_MULTIPLE_PARENTS), [{
211217
hash: '52c293a05038d865604c2284aa8698bd087915a1',
212218
message: 'This is a commit message.',
213219
parents: ['8e5a374372b8393906c7e380dbb09349c5385554', 'df27d8c75b129ab9b178b386077da2822101b217'],
220+
authorDate: new Date(1580811030000),
221+
authorName: 'John Doe',
214222
authorEmail: 'john.doe@mail.com',
215223
}]);
216224
});
217225

218226
test('no parent commits', function () {
219227
const GIT_OUTPUT_NO_PARENTS = `52c293a05038d865604c2284aa8698bd087915a1
228+
John Doe
220229
john.doe@mail.com
230+
1580811030
221231
222232
This is a commit message.\x00`;
223233

224234
assert.deepEqual(parseGitCommits(GIT_OUTPUT_NO_PARENTS), [{
225235
hash: '52c293a05038d865604c2284aa8698bd087915a1',
226236
message: 'This is a commit message.',
227237
parents: [],
238+
authorDate: new Date(1580811030000),
239+
authorName: 'John Doe',
228240
authorEmail: 'john.doe@mail.com',
229241
}]);
230242
});

0 commit comments

Comments
 (0)