@@ -378,17 +378,15 @@ describe('monorepo-workflow-operations', () => {
378
378
) ;
379
379
await fs . promises . writeFile ( releaseSpecPath , 'release spec' ) ;
380
380
381
- try {
382
- await followMonorepoWorkflow ( {
381
+ await expect (
382
+ followMonorepoWorkflow ( {
383
383
project,
384
384
tempDirectoryPath : sandbox . directoryPath ,
385
385
firstRemovingExistingReleaseSpecification : true ,
386
386
stdout,
387
387
stderr,
388
- } ) ;
389
- } catch {
390
- // ignore the error
391
- }
388
+ } ) ,
389
+ ) . rejects . toThrow ( expect . anything ( ) ) ;
392
390
393
391
expect ( await fs . promises . stat ( releaseSpecPath ) ) . toStrictEqual (
394
392
expect . anything ( ) ,
@@ -416,17 +414,15 @@ describe('monorepo-workflow-operations', () => {
416
414
)
417
415
. mockRejectedValue ( new Error ( 'oops' ) ) ;
418
416
419
- try {
420
- await followMonorepoWorkflow ( {
417
+ await expect (
418
+ followMonorepoWorkflow ( {
421
419
project,
422
420
tempDirectoryPath : sandbox . directoryPath ,
423
421
firstRemovingExistingReleaseSpecification : true ,
424
422
stdout,
425
423
stderr,
426
- } ) ;
427
- } catch {
428
- // ignore the error
429
- }
424
+ } ) ,
425
+ ) . rejects . toThrow ( expect . anything ( ) ) ;
430
426
431
427
await expect (
432
428
fs . promises . readFile (
@@ -800,17 +796,15 @@ describe('monorepo-workflow-operations', () => {
800
796
) ;
801
797
await fs . promises . writeFile ( releaseSpecPath , 'release spec' ) ;
802
798
803
- try {
804
- await followMonorepoWorkflow ( {
799
+ await expect (
800
+ followMonorepoWorkflow ( {
805
801
project,
806
802
tempDirectoryPath : sandbox . directoryPath ,
807
803
firstRemovingExistingReleaseSpecification : true ,
808
804
stdout,
809
805
stderr,
810
- } ) ;
811
- } catch {
812
- // ignore the error
813
- }
806
+ } ) ,
807
+ ) . rejects . toThrow ( expect . anything ( ) ) ;
814
808
815
809
expect ( await fs . promises . stat ( releaseSpecPath ) ) . toStrictEqual (
816
810
expect . anything ( ) ,
@@ -843,17 +837,15 @@ describe('monorepo-workflow-operations', () => {
843
837
) ;
844
838
await fs . promises . writeFile ( releaseSpecPath , 'release spec' ) ;
845
839
846
- try {
847
- await followMonorepoWorkflow ( {
840
+ await expect (
841
+ followMonorepoWorkflow ( {
848
842
project,
849
843
tempDirectoryPath : sandbox . directoryPath ,
850
844
firstRemovingExistingReleaseSpecification : true ,
851
845
stdout,
852
846
stderr,
853
- } ) ;
854
- } catch {
855
- // ignore the error
856
- }
847
+ } ) ,
848
+ ) . rejects . toThrow ( expect . anything ( ) ) ;
857
849
858
850
await expect (
859
851
fs . promises . readFile ( releaseSpecPath , 'utf8' ) ,
@@ -1251,17 +1243,15 @@ describe('monorepo-workflow-operations', () => {
1251
1243
} ,
1252
1244
} ) ;
1253
1245
1254
- try {
1255
- await followMonorepoWorkflow ( {
1246
+ await expect (
1247
+ followMonorepoWorkflow ( {
1256
1248
project,
1257
1249
tempDirectoryPath : sandbox . directoryPath ,
1258
1250
firstRemovingExistingReleaseSpecification : false ,
1259
1251
stdout,
1260
1252
stderr,
1261
- } ) ;
1262
- } catch {
1263
- // ignore the error
1264
- }
1253
+ } ) ,
1254
+ ) . rejects . toThrow ( expect . anything ( ) ) ;
1265
1255
1266
1256
expect (
1267
1257
await fs . promises . stat (
@@ -1291,17 +1281,15 @@ describe('monorepo-workflow-operations', () => {
1291
1281
)
1292
1282
. mockRejectedValue ( new Error ( 'oops' ) ) ;
1293
1283
1294
- try {
1295
- await followMonorepoWorkflow ( {
1284
+ await expect (
1285
+ followMonorepoWorkflow ( {
1296
1286
project,
1297
1287
tempDirectoryPath : sandbox . directoryPath ,
1298
1288
firstRemovingExistingReleaseSpecification : false ,
1299
1289
stdout,
1300
1290
stderr,
1301
- } ) ;
1302
- } catch {
1303
- // ignore the error
1304
- }
1291
+ } ) ,
1292
+ ) . rejects . toThrow ( expect . anything ( ) ) ;
1305
1293
1306
1294
await expect (
1307
1295
fs . promises . readFile (
@@ -1675,17 +1663,15 @@ describe('monorepo-workflow-operations', () => {
1675
1663
) ;
1676
1664
await fs . promises . writeFile ( releaseSpecPath , 'release spec' ) ;
1677
1665
1678
- try {
1679
- await followMonorepoWorkflow ( {
1666
+ await expect (
1667
+ followMonorepoWorkflow ( {
1680
1668
project,
1681
1669
tempDirectoryPath : sandbox . directoryPath ,
1682
1670
firstRemovingExistingReleaseSpecification : false ,
1683
1671
stdout,
1684
1672
stderr,
1685
- } ) ;
1686
- } catch {
1687
- // ignore the error
1688
- }
1673
+ } ) ,
1674
+ ) . rejects . toThrow ( expect . anything ( ) ) ;
1689
1675
1690
1676
expect ( await fs . promises . stat ( releaseSpecPath ) ) . toStrictEqual (
1691
1677
expect . anything ( ) ,
0 commit comments