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

Function timelineOf

packages/effect/test/ui/WorkedExample.test.ts:286–336  ·  view source on GitHub ↗
(flush: TestHost.Flush)

Source from the content-addressed store, hash-verified

284 // What the tree did, as the facts and what followed from each, without the entries' numbers: a
285 // render that ran earlier or later numbers them differently and changes nothing else.
286 const timelineOf = (flush: TestHost.Flush) => {
287 const { deps } = setup("/users/1")
288 return run(
289 deps,
290 Effect.gen(function*() {
291 const root = yield* mount
292 yield* TestHost.settle
293 yield* TestClock.adjust("10 millis")
294 click(root, "Rename")
295 yield* TestHost.settle
296 rename(root, "B")
297 yield* TestHost.settle
298 yield* TestClock.adjust("100 millis")
299 yield* TestHost.settle
300 yield* TestClock.adjust("100 millis")
301 yield* TestHost.settle
302 yield* navigate("/")
303 yield* TestClock.adjust("10 millis")
304 yield* TestHost.settle
305 const log = root.log()
306 const mounted = log.filter((entry) => entry._tag === "Mounted")
307 assert.isAbove(mounted.length, 3)
308 for (const entry of mounted) {
309 const replay = Story.fromLog(
310 entry.component as Component.Component<
311 any,
312 any,
313 any,
314 any,
315 any,
316 any,
317 any,
318 any,
319 any
320 >,
321 log,
322 { path: entry.path }
323 )
324 assert.isUndefined(replay.divergence, entry.path)
325 }
326 return {
327 text: root.text(),
328 timeline: TestHost.formatTimeline(log).replace(
329 / ?\(?(after )?#\d+\)? ?/g,
330 " "
331 )
332 }
333 }),
334 flush
335 )
336 }
337
338 it.effect("one script replays and gives one timeline, whenever the render flush runs", () =>
339 Effect.gen(function*() {

Callers 1

Calls 10

adjustMethod · 0.80
setupFunction · 0.70
runFunction · 0.70
clickFunction · 0.70
renameFunction · 0.70
logMethod · 0.65
textMethod · 0.65
navigateFunction · 0.50
filterMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected