This commit is contained in:
Joao Moreno
2018-07-06 15:31:43 +02:00
parent e4d42b6b9b
commit ba98812272
3 changed files with 13 additions and 10 deletions

View File

@@ -177,7 +177,7 @@ suite('git', () => {
});
suite('parseGitCommit', () => {
test('single previous commit', () => {
test('single parent commit', () => {
const GIT_OUTPUT_SINGLE_PARENT = `52c293a05038d865604c2284aa8698bd087915a1
8e5a374372b8393906c7e380dbb09349c5385554
This is a commit message.`;
@@ -185,11 +185,11 @@ This is a commit message.`;
assert.deepEqual(parseGitCommit(GIT_OUTPUT_SINGLE_PARENT), {
hash: '52c293a05038d865604c2284aa8698bd087915a1',
message: 'This is a commit message.',
previousHashes: ['8e5a374372b8393906c7e380dbb09349c5385554']
parents: ['8e5a374372b8393906c7e380dbb09349c5385554']
});
});
test('multiple previous commits', () => {
test('multiple parent commits', () => {
const GIT_OUTPUT_MULTIPLE_PARENTS = `52c293a05038d865604c2284aa8698bd087915a1
8e5a374372b8393906c7e380dbb09349c5385554 df27d8c75b129ab9b178b386077da2822101b217
This is a commit message.`;
@@ -197,11 +197,11 @@ This is a commit message.`;
assert.deepEqual(parseGitCommit(GIT_OUTPUT_MULTIPLE_PARENTS), {
hash: '52c293a05038d865604c2284aa8698bd087915a1',
message: 'This is a commit message.',
previousHashes: ['8e5a374372b8393906c7e380dbb09349c5385554', 'df27d8c75b129ab9b178b386077da2822101b217']
parents: ['8e5a374372b8393906c7e380dbb09349c5385554', 'df27d8c75b129ab9b178b386077da2822101b217']
});
});
test('no previous commits', async () => {
test('no parent commits', async () => {
const GIT_OUTPUT_NO_PARENTS = `52c293a05038d865604c2284aa8698bd087915a1
This is a commit message.`;
@@ -209,7 +209,7 @@ This is a commit message.`;
assert.deepEqual(parseGitCommit(GIT_OUTPUT_NO_PARENTS), {
hash: '52c293a05038d865604c2284aa8698bd087915a1',
message: 'This is a commit message.',
previousHashes: []
parents: []
});
});
});