MCPcopy Create free account
hub / github.com/Effect-TS/effect / warningStart

Method warningStart

packages/effect/src/TestClock.ts:279–293  ·  view source on GitHub ↗

* Forks a fiber that will display a warning message if a test is using time * but is not advancing the `TestClock`.

()

Source from the content-addressed store, hash-verified

277 * but is not advancing the `TestClock`.
278 */
279 warningStart(): Effect.Effect<void> {
280 return synchronized.updateSomeEffect(this.warningState, (data) =>
281 WarningData.isStart(data) ?
282 Option.some(
283 pipe(
284 this.live.provide(
285 pipe(effect.logWarning(warning), effect.delay(Duration.seconds(5)))
286 ),
287 core.interruptible,
288 fiberRuntime.fork,
289 core.map((fiber) => WarningData.pending(fiber))
290 )
291 ) :
292 Option.none())
293 }
294 /**
295 * Cancels the warning message that is displayed if a test is using time but
296 * is not advancing the `TestClock`.

Callers 1

sleepMethod · 0.95

Calls 3

pipeFunction · 0.70
provideMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected