-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from nearform/feature/limiting-commit-message-…
…body Limiting commit messages in issue description
- Loading branch information
Showing
6 changed files
with
342 additions
and
6 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
const utils = require('../src/utils'); | ||
|
||
const { | ||
unreleasedCommitsData1, | ||
} = require('./testData'); | ||
|
||
test('Should limit commit message to only first line', async () => { | ||
const formattedCommitMessage = utils.formatCommitMessage(unreleasedCommitsData1[0].commit.message, 1); | ||
expect(formattedCommitMessage).toStrictEqual('variable changed'); | ||
}); | ||
|
||
test('Should return full commit message', async () => { | ||
const formattedCommitMessage = utils.formatCommitMessage(unreleasedCommitsData1[0].commit.message, 0); | ||
expect(formattedCommitMessage).toStrictEqual(`variable changed | ||
this message has multiple lines | ||
`); | ||
}); | ||
|
||
test('Should trim start and end of commit message while limiting the lines', async () => { | ||
const formattedCommitMessage = utils.formatCommitMessage(unreleasedCommitsData1[0].commit.message, 5); | ||
expect(formattedCommitMessage).toStrictEqual(`variable changed | ||
this message has multiple lines`); | ||
}); |