-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a step to check if the commit is a breaking change and append it to the message Fixes ##11
- Loading branch information
1 parent
4cdee96
commit 4249677
Showing
8 changed files
with
98 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import validateDescription from './validateDescription'; | ||
|
||
describe('#validateDescription', () => { | ||
describe('#Errors', () => { | ||
it('should return error if input is empty and breaking change is true', () => { | ||
expect(validateDescription('', { isBreak: true })).toContain( | ||
'specify a description for breaking changes', | ||
); | ||
}); | ||
|
||
it('should return error if input is not lowercase', () => { | ||
expect( | ||
validateDescription('LOREM ipsum dolor sit amet', { | ||
isBreak: false, | ||
}), | ||
).toContain('value must be all lowercase'); | ||
}); | ||
}); | ||
|
||
describe('#Success', () => { | ||
it('should return true if input is empty and breaking change is false', () => { | ||
expect(validateDescription('', { isBreak: false })).toBeTruthy(); | ||
}); | ||
|
||
it('should return true if input has value and breaking change is true', () => { | ||
expect( | ||
validateDescription('requires new user dependency', { isBreak: true }), | ||
).toBeTruthy(); | ||
}); | ||
}); | ||
}); |
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,9 @@ | ||
import validateLowercase from './validateLowercase'; | ||
|
||
export default (input: string, answers: any) => { | ||
if (answers.isBreak && (!input || input === '')) { | ||
return 'Must specify a description for breaking changes'; | ||
} | ||
|
||
return validateLowercase(input); | ||
}; |
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