Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/gitmoji-changelog-cli/src/cli.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ describe('generate changelog', () => {
expect(getChangelog()).includes(['1.0.0'])
})

it("should get a 1.0.0 version while initializing changelog by calling cli with explicit init argument and having package.json's version set to 1.0.0", async () => {
await makeChanges('file1')
await commit(':sparkles: Add some file')
await bumpVersion('1.0.0')
gitmojiChangelog(['init'])
await commit(':bookmark: Version 1.0.0')

expect(getChangelog()).includes(['1.0.0'])
})

it('should use a custom commit mapping to create commit categories', async () => {
makeCustomConfig({
commitMapping: [
Expand Down
2 changes: 1 addition & 1 deletion packages/gitmoji-changelog-cli/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ yargs
execute(mode)(argv)
})

.command('init', 'Initialize changelog from tags', noop, execute('init'))
.command('init', 'Initialize changelog from tags', noop, (argv) => execute('init')({ ...argv, release: 'from-package' }))

.command('update [release]', 'Update changelog with a new version', (command) => {
command.positional('release', {
Expand Down