File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
gitmoji-changelog-cli/src
gitmoji-changelog-core/src Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,24 @@ describe('generate changelog', () => {
128128
129129 expect ( getChangelog ( ) ) . includes ( [ '1.0.0' , '2.0.0' ] )
130130 } )
131+
132+ it ( 'should get two versions 1.0.0 and 2.0.0 while updating changelog after tagging a version 2.0.0' , async ( ) => {
133+ await makeChanges ( 'file1' )
134+ await commit ( ':sparkles: Add some file' )
135+ await bumpVersion ( '1.0.0' )
136+ gitmojiChangelog ( )
137+ await commit ( ':bookmark: Version 1.0.0' )
138+ await tag ( '1.0.0' )
139+
140+ await makeChanges ( 'file2' )
141+ await commit ( ':sparkles: Add another file' )
142+ await bumpVersion ( '2.0.0' )
143+ await tag ( '2.0.0' )
144+ gitmojiChangelog ( )
145+
146+ expect ( getChangelog ( ) ) . includes ( [ '1.0.0' , '2.0.0' ] )
147+ } )
148+
131149 it ( "should get two versions 1.0.0 and 2.0.0 while updating changelog by calling cli with 2.0.0 and having package.json's version set to 1.0.0" , async ( ) => {
132150 await makeChanges ( 'file1' )
133151 await commit ( ':sparkles: Add some file' )
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ async function generateChangelog(options = {}) {
159159 groupSimilarCommits,
160160 } )
161161
162- if ( mode === 'update' && isEmpty ( changes [ 0 ] . groups ) ) {
162+ if ( mode === 'update' && changes . length === 1 && isEmpty ( changes [ 0 ] . groups ) ) {
163163 throw new Error ( 'No changes found. You may need to fetch or pull the last changes.' )
164164 }
165165
You can’t perform that action at this time.
0 commit comments