@@ -8,7 +8,7 @@ import { writeChangelog } from '../../changelog/writeChangelog';
88import { getPackageInfos } from '../../monorepo/getPackageInfos' ;
99import { readChangeFiles } from '../../changefile/readChangeFiles' ;
1010import { BeachballOptions } from '../../types/BeachballOptions' ;
11- import { ChangeFileInfo , ChangeInfo } from '../../types/ChangeInfo' ;
11+ import { ChangeFileInfo } from '../../types/ChangeInfo' ;
1212import type { Repository } from '../../__fixtures__/repository' ;
1313import { getDefaultOptions } from '../../options/getDefaultOptions' ;
1414
@@ -296,51 +296,4 @@ describe('writeChangelog', () => {
296296 // Validate grouped changelog for foo and bar packages
297297 expect ( readChangelogMd ( repo . pathTo ( 'packages/foo' ) ) ) . toMatchSnapshot ( ) ;
298298 } ) ;
299-
300- it ( 'runs transform.changeFiles functions if provided' , async ( ) => {
301- const editedComment : string = 'Edited comment for testing' ;
302- repo = monoRepoFactory . cloneRepository ( ) ;
303-
304- const options = getOptions ( {
305- command : 'change' ,
306- transform : {
307- changeFiles : ( changeFile , changeFilePath , { command } ) => {
308- // For test, we will be changing the comment based on the package name
309- if ( ( changeFile as ChangeInfo ) . packageName === 'foo' ) {
310- ( changeFile as ChangeInfo ) . comment = editedComment ;
311- ( changeFile as ChangeInfo ) . command = command ;
312- }
313- return changeFile as ChangeInfo ;
314- } ,
315- } ,
316- changelog : {
317- groups : [
318- {
319- masterPackageName : 'foo' ,
320- changelogPath : repo . pathTo ( 'packages/foo' ) ,
321- include : [ 'packages/foo' , 'packages/bar' ] ,
322- } ,
323- ] ,
324- } ,
325- } ) ;
326-
327- repo . commitChange ( 'foo' ) ;
328- generateChangeFiles ( [ getChange ( 'foo' , 'comment 1' ) ] , options ) ;
329-
330- repo . commitChange ( 'bar' ) ;
331- generateChangeFiles ( [ getChange ( 'bar' , 'comment 2' ) ] , options ) ;
332-
333- const packageInfos = getPackageInfos ( repo . rootPath ) ;
334- const changes = readChangeFiles ( options , packageInfos ) ;
335-
336- // Verify that the comment of only the intended change file is changed
337- for ( const { change, changeFile } of changes ) {
338- if ( changeFile . startsWith ( 'foo' ) ) {
339- expect ( change . comment ) . toBe ( editedComment ) ;
340- expect ( change . command ) . toEqual ( 'change' ) ;
341- } else {
342- expect ( change . comment ) . toBe ( 'comment 2' ) ;
343- }
344- }
345- } ) ;
346299} ) ;
0 commit comments