t3-code-android-nightly/.repos/effect-smol/packages/effect/test/FiberSetRuntimePropagation.test.ts
2026-09-07 21:54:44 -07:00

16 lines
620 B
TypeScript

import { describe, it } from "@effect/vitest"
import { assertTrue } from "@effect/vitest/utils"
import { Deferred, Effect, Fiber, FiberSet } from "effect"
describe("FiberSet.runtime interruption propagation", () => {
it.effect("records external interruption when enabled", () =>
Effect.gen(function*() {
const set = yield* FiberSet.make()
const run = yield* FiberSet.runtime(set)()
const fiber = run(Effect.never, { propagateInterruption: true })
yield* Fiber.interrupt(fiber)
assertTrue(yield* Deferred.isDone(set.deferred), "external interruption should be recorded")
}))
})