| 1 | import * as Effect from "effect/Effect"; |
| 2 | import * as Random from "effect/Random"; |
| 3 | import { TestClock } from "effect/testing"; |
| 4 | |
| 5 | export function provideDeterministicTestRuntime<A, E, R>( |
| 6 | effect: Effect.Effect<A, E, R>, |
| 7 | options: { readonly randomSeed?: number } = {}, |
| 8 | ) { |
| 9 | return effect.pipe( |
| 10 | Effect.provide(TestClock.layer()), |
| 11 | Random.withSeed(options.randomSeed ?? 0x1234_5678), |
| 12 | ); |
| 13 | } |