(data: Data)
| 436 | * @since 2.0.0 |
| 437 | */ |
| 438 | export const live = (data: Data): Layer.Layer<TestClock, never, Annotations.TestAnnotations | Live.TestLive> => |
| 439 | layer.scoped( |
| 440 | TestClock, |
| 441 | core.gen(function*() { |
| 442 | const live = yield* Live.TestLive |
| 443 | const annotations = yield* Annotations.TestAnnotations |
| 444 | const clockState = yield* core.sync(() => ref.unsafeMake(data)) |
| 445 | const warningState = yield* circular.makeSynchronized(WarningData.start) |
| 446 | const suspendedWarningState = yield* circular.makeSynchronized(SuspendedWarningData.start) |
| 447 | const testClock = new TestClockImpl(clockState, live, annotations, warningState, suspendedWarningState) |
| 448 | yield* fiberRuntime.withClockScoped(testClock) |
| 449 | yield* fiberRuntime.addFinalizer( |
| 450 | () => core.zipRight(testClock.warningDone(), testClock.suspendedWarningDone()) |
| 451 | ) |
| 452 | return testClock |
| 453 | }) |
| 454 | ) |
| 455 | |
| 456 | /** |
| 457 | * @since 2.0.0 |
no test coverage detected