@@ -169,7 +169,7 @@ describe('updateVersions', function () {
169
169
dependsOn ?: string [ ] ;
170
170
} > ,
171
171
args : string [ ] = [ ] ,
172
- { commitSha = '' } = { }
172
+ { commitSha = '' } = { } ,
173
173
) => {
174
174
const root = 'root' ;
175
175
@@ -200,7 +200,7 @@ describe('updateVersions', function () {
200
200
. withArgs ( path . join ( root , 'package.json' ) )
201
201
. resolves ( {
202
202
version : packageVersion ,
203
- workspaces : workspacePaths . map ( ( workspace ) => path . posix . join ( ...workspace . relPath ) ) ,
203
+ workspaces : { packages : workspacePaths . map ( ( workspace ) => path . posix . join ( ...workspace . relPath ) ) } ,
204
204
} ) ;
205
205
206
206
sandbox
@@ -219,14 +219,14 @@ describe('updateVersions', function () {
219
219
deprecated : workspace . deprecated ,
220
220
dependencies : ( workspace . dependsOn ?? [ ] ) . reduce (
221
221
( acc , name ) => ( { ...acc , [ name ] : dummyVersion } ) ,
222
- { }
222
+ { } ,
223
223
) ,
224
224
} ) ;
225
225
226
226
let packageMatch = sinon . match . hasOwn ( 'version' , workspace . expectedVersion ) ;
227
227
if ( workspace . expectedDependencies ) {
228
228
packageMatch = packageMatch . and (
229
- sinon . match . hasOwn ( 'dependencies' , sinon . match ( workspace . expectedDependencies ) )
229
+ sinon . match . hasOwn ( 'dependencies' , sinon . match ( workspace . expectedDependencies ) ) ,
230
230
) ;
231
231
}
232
232
@@ -300,7 +300,7 @@ describe('updateVersions', function () {
300
300
} ,
301
301
} ,
302
302
] ,
303
- [ expectedVersion ]
303
+ [ expectedVersion ] ,
304
304
) ;
305
305
} ) ;
306
306
@@ -339,8 +339,37 @@ describe('updateVersions', function () {
339
339
} ,
340
340
] ,
341
341
[ '--buildLabel' , 'dev' , '--git' , 'true' , '--date' , dateFormat ] ,
342
- { commitSha : 'COMMIT' }
342
+ { commitSha : 'COMMIT' } ,
343
343
) ;
344
344
} ) ;
345
+
346
+ it ( 'runs properly' , async function ( ) {
347
+ const writeFileStub = sandbox . stub ( file , 'writeJsonFile' ) . returns ( Promise . resolve ( ) ) ;
348
+ const version = '4.24.0' ;
349
+ await command (
350
+ [
351
+ version ,
352
+ '--buildLabel' ,
353
+ 'dev' ,
354
+ '--internal' ,
355
+ 'internal' ,
356
+ '--preview' ,
357
+ 'preview' ,
358
+ '--deprecated' ,
359
+ 'deprecated' ,
360
+ '--date' ,
361
+ 'YYYYMMDD' ,
362
+ '--git' ,
363
+ 'false' ,
364
+ ] ,
365
+ true ,
366
+ ) ( ) ;
367
+
368
+ assert . ok ( writeFileStub . called ) ;
369
+ const packagesAssertion = ( writeFileStub . args as [ string , Package ] [ ] )
370
+ . filter ( ( [ , pkg ] ) => ! pkg . private )
371
+ . every ( ( [ , pkg ] ) => pkg . version . startsWith ( version ) ) ;
372
+ assert . ok ( packagesAssertion ) ;
373
+ } ) ;
345
374
} ) ;
346
375
} ) ;
0 commit comments