| 1 | import { describe, it } from "@effect/vitest" |
| 2 | import { assertTrue } from "@effect/vitest/utils" |
| 3 | import { Deferred, Effect, Fiber, FiberSet } from "effect" |
| 4 | |
| 5 | describe("FiberSet.runtime interruption propagation", () => { |
| 6 | it.effect("records external interruption when enabled", () => |
| 7 | Effect.gen(function*() { |
| 8 | const set = yield* FiberSet.make() |
| 9 | const run = yield* FiberSet.runtime(set)() |
| 10 | const fiber = run(Effect.never, { propagateInterruption: true }) |
| 11 | |
| 12 | yield* Fiber.interrupt(fiber) |
| 13 | |
| 14 | assertTrue(yield* Deferred.isDone(set.deferred), "external interruption should be recorded") |
| 15 | })) |
| 16 | }) |