Skip to content

Commit e367ac1

Browse files
committed
Stop ignoring errors
1 parent fc30d38 commit e367ac1

File tree

1 file changed

+28
-42
lines changed

1 file changed

+28
-42
lines changed

src/monorepo-workflow-operations.test.ts

Lines changed: 28 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -378,17 +378,15 @@ describe('monorepo-workflow-operations', () => {
378378
);
379379
await fs.promises.writeFile(releaseSpecPath, 'release spec');
380380

381-
try {
382-
await followMonorepoWorkflow({
381+
await expect(
382+
followMonorepoWorkflow({
383383
project,
384384
tempDirectoryPath: sandbox.directoryPath,
385385
firstRemovingExistingReleaseSpecification: true,
386386
stdout,
387387
stderr,
388-
});
389-
} catch {
390-
// ignore the error
391-
}
388+
}),
389+
).rejects.toThrow(expect.anything());
392390

393391
expect(await fs.promises.stat(releaseSpecPath)).toStrictEqual(
394392
expect.anything(),
@@ -416,17 +414,15 @@ describe('monorepo-workflow-operations', () => {
416414
)
417415
.mockRejectedValue(new Error('oops'));
418416

419-
try {
420-
await followMonorepoWorkflow({
417+
await expect(
418+
followMonorepoWorkflow({
421419
project,
422420
tempDirectoryPath: sandbox.directoryPath,
423421
firstRemovingExistingReleaseSpecification: true,
424422
stdout,
425423
stderr,
426-
});
427-
} catch {
428-
// ignore the error
429-
}
424+
}),
425+
).rejects.toThrow(expect.anything());
430426

431427
await expect(
432428
fs.promises.readFile(
@@ -800,17 +796,15 @@ describe('monorepo-workflow-operations', () => {
800796
);
801797
await fs.promises.writeFile(releaseSpecPath, 'release spec');
802798

803-
try {
804-
await followMonorepoWorkflow({
799+
await expect(
800+
followMonorepoWorkflow({
805801
project,
806802
tempDirectoryPath: sandbox.directoryPath,
807803
firstRemovingExistingReleaseSpecification: true,
808804
stdout,
809805
stderr,
810-
});
811-
} catch {
812-
// ignore the error
813-
}
806+
}),
807+
).rejects.toThrow(expect.anything());
814808

815809
expect(await fs.promises.stat(releaseSpecPath)).toStrictEqual(
816810
expect.anything(),
@@ -843,17 +837,15 @@ describe('monorepo-workflow-operations', () => {
843837
);
844838
await fs.promises.writeFile(releaseSpecPath, 'release spec');
845839

846-
try {
847-
await followMonorepoWorkflow({
840+
await expect(
841+
followMonorepoWorkflow({
848842
project,
849843
tempDirectoryPath: sandbox.directoryPath,
850844
firstRemovingExistingReleaseSpecification: true,
851845
stdout,
852846
stderr,
853-
});
854-
} catch {
855-
// ignore the error
856-
}
847+
}),
848+
).rejects.toThrow(expect.anything());
857849

858850
await expect(
859851
fs.promises.readFile(releaseSpecPath, 'utf8'),
@@ -1251,17 +1243,15 @@ describe('monorepo-workflow-operations', () => {
12511243
},
12521244
});
12531245

1254-
try {
1255-
await followMonorepoWorkflow({
1246+
await expect(
1247+
followMonorepoWorkflow({
12561248
project,
12571249
tempDirectoryPath: sandbox.directoryPath,
12581250
firstRemovingExistingReleaseSpecification: false,
12591251
stdout,
12601252
stderr,
1261-
});
1262-
} catch {
1263-
// ignore the error
1264-
}
1253+
}),
1254+
).rejects.toThrow(expect.anything());
12651255

12661256
expect(
12671257
await fs.promises.stat(
@@ -1291,17 +1281,15 @@ describe('monorepo-workflow-operations', () => {
12911281
)
12921282
.mockRejectedValue(new Error('oops'));
12931283

1294-
try {
1295-
await followMonorepoWorkflow({
1284+
await expect(
1285+
followMonorepoWorkflow({
12961286
project,
12971287
tempDirectoryPath: sandbox.directoryPath,
12981288
firstRemovingExistingReleaseSpecification: false,
12991289
stdout,
13001290
stderr,
1301-
});
1302-
} catch {
1303-
// ignore the error
1304-
}
1291+
}),
1292+
).rejects.toThrow(expect.anything());
13051293

13061294
await expect(
13071295
fs.promises.readFile(
@@ -1675,17 +1663,15 @@ describe('monorepo-workflow-operations', () => {
16751663
);
16761664
await fs.promises.writeFile(releaseSpecPath, 'release spec');
16771665

1678-
try {
1679-
await followMonorepoWorkflow({
1666+
await expect(
1667+
followMonorepoWorkflow({
16801668
project,
16811669
tempDirectoryPath: sandbox.directoryPath,
16821670
firstRemovingExistingReleaseSpecification: false,
16831671
stdout,
16841672
stderr,
1685-
});
1686-
} catch {
1687-
// ignore the error
1688-
}
1673+
}),
1674+
).rejects.toThrow(expect.anything());
16891675

16901676
expect(await fs.promises.stat(releaseSpecPath)).toStrictEqual(
16911677
expect.anything(),

0 commit comments

Comments
 (0)