File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,31 @@ describe('cli', function () {
178
178
content . should . not . match ( / l e g a c y h e a d e r f o r m a t / )
179
179
} )
180
180
181
+ it ( 'retains any frontmatter in an existing Changelog with correct header' , async function ( ) {
182
+ const { header } = require ( '../defaults' )
183
+ const frontMatter =
184
+ '---\nstatus: new\n---'
185
+
186
+ const changelog101 =
187
+ '### [1.0.1](/compare/v1.0.0...v1.0.1) (YYYY-MM-DD)\n\n\n### Bug Fixes\n\n* patch release ABCDEFXY\n'
188
+
189
+ const changelog100 =
190
+ '### [1.0.0](/compare/v0.0.1...v1.0.0) (YYYY-MM-DD)\n\n\n### Features\n\n* Version one feature set\n'
191
+
192
+ const initialChangelog = frontMatter + '\n' + header + '\n' + changelog100 ;
193
+
194
+ mock ( {
195
+ bump : 'patch' ,
196
+ changelog : changelog101 ,
197
+ fs : { 'CHANGELOG.md' : initialChangelog } ,
198
+ tags : [ 'v1.0.0' ]
199
+ } )
200
+ await exec ( )
201
+
202
+ let content = fs . readFileSync ( 'CHANGELOG.md' , 'utf-8' )
203
+ content . should . equal ( frontMatter + '\n' + header + '\n' + changelog101 + changelog100 )
204
+ } )
205
+
181
206
it ( 'appends the new release above the last release, removing the old header (new format)' , async function ( ) {
182
207
const { header } = require ( '../defaults' )
183
208
const changelog1 =
You can’t perform that action at this time.
0 commit comments