New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(conventional-changelog-conventionalcommits): optional config #1120
fix(conventional-changelog-conventionalcommits): optional config #1120
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. Thanks for the PR!
@@ -27,7 +27,7 @@ function createConventionalRecommendedBumpOpts (config, parserOpts) { | |||
} | |||
}) | |||
|
|||
if (config.preMajor && level < 2) { | |||
if (config?.preMajor && level < 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add test case for that.
preset: { | ||
name: 'conventionalcommits' | ||
} | ||
preset: 'conventionalcommits' | ||
}, {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change it?
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
it('should allow the string `conventionalcommits` as the preset option', async () => { | ||
preparing(2) | ||
|
||
await expect(() => conventionalRecommendedBump({ | ||
cwd: testTools.cwd, | ||
preset: 'conventionalcommits' | ||
}, {})).not.toThrowError() | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, I decided to add a test case. 😁
It throws error, when the preset option is set to the string
conventionalcommits
.