-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
1,441 additions
and
1,455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,15 @@ | ||
import { | ||
getFirstCommitMessageLine, | ||
getFormattedCommitMessage, | ||
} from './commitFormatters'; | ||
import { getFirstLine } from './commitFormatters'; | ||
|
||
describe('getFirstCommitMessageLine', () => { | ||
it('should only return the first line of the message', () => { | ||
expect( | ||
getFirstCommitMessageLine( | ||
getFirstLine( | ||
'My commit message (#1234)\n\n Additional commit message body' | ||
) | ||
).toEqual('My commit message (#1234)'); | ||
}); | ||
|
||
it('should return the commit message as-is', () => { | ||
expect(getFirstCommitMessageLine('My commit message')).toEqual( | ||
'My commit message' | ||
); | ||
}); | ||
}); | ||
|
||
describe('getFormattedCommitMessage', () => { | ||
it('should return the first message line verbatim', () => { | ||
expect( | ||
getFormattedCommitMessage({ | ||
message: 'This is my commit message (#1234)\n\nthis is a second line', | ||
pullNumber: 1234, | ||
sha: 'sha123456789', | ||
}) | ||
).toBe('This is my commit message (#1234)'); | ||
}); | ||
|
||
it('should add pullNumber as suffix', () => { | ||
expect( | ||
getFormattedCommitMessage({ | ||
message: 'This is my commit message\n\nthis is a second line', | ||
pullNumber: 1234, | ||
sha: 'sha123456789', | ||
}) | ||
).toBe('This is my commit message (#1234)'); | ||
}); | ||
|
||
it('should add commit sha as suffix', () => { | ||
expect( | ||
getFormattedCommitMessage({ | ||
message: 'This is my commit message\n\nthis is a second line', | ||
sha: 'sha123456789', | ||
}) | ||
).toBe('This is my commit message (sha12345)'); | ||
expect(getFirstLine('My commit message')).toEqual('My commit message'); | ||
}); | ||
}); |
Oops, something went wrong.