Skip to content

Commit

Permalink
update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
zhang.jiayue committed Jan 21, 2020
1 parent 5ef3822 commit e46c4b3
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions extensions/git/src/test/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,41 +191,54 @@ suite('git', () => {
const GIT_OUTPUT_SINGLE_PARENT = `52c293a05038d865604c2284aa8698bd087915a1
john.doe@mail.com
8e5a374372b8393906c7e380dbb09349c5385554
This is a commit message.`;
This is a commit message.
john.doe
1579589069
`;

assert.deepEqual(parseGitCommit(GIT_OUTPUT_SINGLE_PARENT), {
hash: '52c293a05038d865604c2284aa8698bd087915a1',
message: 'This is a commit message.',
parents: ['8e5a374372b8393906c7e380dbb09349c5385554'],
authorEmail: 'john.doe@mail.com',
authorName: 'john.doe',
commitData: new Date(1579589069000),
});
});

test('multiple parent commits', function () {
const GIT_OUTPUT_MULTIPLE_PARENTS = `52c293a05038d865604c2284aa8698bd087915a1
john.doe@mail.com
8e5a374372b8393906c7e380dbb09349c5385554 df27d8c75b129ab9b178b386077da2822101b217
This is a commit message.`;
This is a commit message.
john.doe
1579589069`;

assert.deepEqual(parseGitCommit(GIT_OUTPUT_MULTIPLE_PARENTS), {
hash: '52c293a05038d865604c2284aa8698bd087915a1',
message: 'This is a commit message.',
parents: ['8e5a374372b8393906c7e380dbb09349c5385554', 'df27d8c75b129ab9b178b386077da2822101b217'],
authorEmail: 'john.doe@mail.com',
authorName: 'john.doe',
commitData: new Date(1579589069000),
});
});

test('no parent commits', function () {
const GIT_OUTPUT_NO_PARENTS = `52c293a05038d865604c2284aa8698bd087915a1
john.doe@mail.com
This is a commit message.`;
This is a commit message.
john.doe
1579589069`;

assert.deepEqual(parseGitCommit(GIT_OUTPUT_NO_PARENTS), {
hash: '52c293a05038d865604c2284aa8698bd087915a1',
message: 'This is a commit message.',
parents: [],
authorEmail: 'john.doe@mail.com',
authorName: 'john.doe',
commitData: new Date(1579589069000),
});
});
});
Expand Down

0 comments on commit e46c4b3

Please sign in to comment.