Skip to content

Commit fa0fa16

Browse files
authored
fix: Correct error message for when the test was interrupted (#5386)
1 parent 3e163b2 commit fa0fa16

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.changeset/yellow-suns-eat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect/vitest": patch
3+
---
4+
5+
Correct error message when the test was interrupted

packages/vitest/src/internal/internal.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ const runPromise = (ctx?: Vitest.TestContext) => <E, A>(effect: Effect.Effect<A,
4040
if (Exit.isSuccess(exit)) {
4141
return () => exit.value
4242
} else {
43+
if (Cause.isInterruptedOnly(exit.cause)) {
44+
return () => {
45+
throw new Error("All fibers interrupted without errors.")
46+
}
47+
}
4348
const errors = Cause.prettyErrors(exit.cause)
4449
for (let i = 1; i < errors.length; i++) {
4550
yield* Effect.logError(errors[i])

0 commit comments

Comments
 (0)