@@ -2,7 +2,6 @@ import { describe, it, expect } from '@jest/globals';
22import { makePackageInfos , type PartialPackageInfos } from '../../__fixtures__/packageInfos' ;
33import { getPackagesToPublish } from '../../publish/getPackagesToPublish' ;
44import { initMockLogs } from '../../__fixtures__/mockLogs' ;
5- import type { BeachballOptions } from '../../types/BeachballOptions' ;
65
76type PartialBumpInfo = Parameters < typeof getPackagesToPublish > [ 0 ] ;
87
@@ -14,12 +13,10 @@ describe('getPackagesToPublish', () => {
1413 * - all packages are in scope and modified
1514 * - all modified packages have changeType: 'patch'
1615 * - logging enabled
17- * - `bump: true`
1816 */
1917 function getPackagesToPublishWrapper (
2018 partialBumpInfo : { packageInfos : PartialPackageInfos } & Partial < Omit < PartialBumpInfo , 'packageInfos' > > ,
21- options ?: Pick < BeachballOptions , 'bump' > ,
22- params ?: Parameters < typeof getPackagesToPublish > [ 2 ]
19+ params ?: Parameters < typeof getPackagesToPublish > [ 1 ]
2320 ) {
2421 const { packageInfos, modifiedPackages = new Set ( Object . keys ( packageInfos ) ) , ...rest } = partialBumpInfo ;
2522 const bumpInfo : PartialBumpInfo = {
@@ -29,7 +26,7 @@ describe('getPackagesToPublish', () => {
2926 calculatedChangeTypes : Object . fromEntries ( [ ...modifiedPackages ] . map ( pkg => [ pkg , 'patch' ] ) ) ,
3027 ...rest ,
3128 } ;
32- return getPackagesToPublish ( bumpInfo , { bump : true , ... options } , { logSkipped : true , ...params } ) ;
29+ return getPackagesToPublish ( bumpInfo , { logSkipped : true , ...params } ) ;
3330 }
3431
3532 it ( 'returns empty if no modified packages' , ( ) => {
@@ -113,7 +110,7 @@ describe('getPackagesToPublish', () => {
113110 } ) ;
114111
115112 // This happens for reasons outlined in https://github.com/microsoft/beachball/issues/1123
116- it ( 'excludes packages without calculated change type with bump: true (default) ' , ( ) => {
113+ it ( 'excludes packages without calculated change type' , ( ) => {
117114 const result = getPackagesToPublishWrapper ( {
118115 packageInfos : { 'pkg-a' : { } , 'pkg-b' : { } } ,
119116 modifiedPackages : new Set ( [ 'pkg-a' , 'pkg-b' ] ) ,
@@ -126,21 +123,6 @@ describe('getPackagesToPublish', () => {
126123 ` ) ;
127124 } ) ;
128125
129- // This might change later if bump: false is actually thought through...
130- // https://github.com/microsoft/beachball/issues/1125
131- it ( 'includes packages without calculated change type with bump: false' , ( ) => {
132- const result = getPackagesToPublishWrapper (
133- {
134- packageInfos : { 'pkg-a' : { } , 'pkg-b' : { } } ,
135- modifiedPackages : new Set ( [ 'pkg-a' , 'pkg-b' ] ) ,
136- calculatedChangeTypes : { 'pkg-a' : 'patch' } ,
137- } ,
138- { bump : false }
139- ) ;
140- expect ( result ) . toEqual ( [ 'pkg-a' , 'pkg-b' ] ) ;
141- expect ( logs . mocks . log ) . not . toHaveBeenCalled ( ) ;
142- } ) ;
143-
144126 it ( 'returns packages in topological order if requested' , ( ) => {
145127 // Sorting is tested in toposortPackages, so just use a simple graph here
146128 const result = getPackagesToPublishWrapper (
@@ -151,7 +133,6 @@ describe('getPackagesToPublish', () => {
151133 'pkg-c' : { } ,
152134 } ,
153135 } ,
154- undefined ,
155136 { toposort : true }
156137 ) ;
157138 expect ( result ) . toEqual ( [ 'pkg-c' , 'pkg-b' , 'pkg-a' ] ) ;
0 commit comments