MCPcopy Index your code
hub / github.com/callstack/agent-device / render

Function render

src/replay/test/progress.ts:44–73  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

42 let spinnerFrameIndex = 0;
43 return {
44 render(event) {
45 if (event.type === 'suite-start') {
46 completedKeys.clear();
47 hasLiveProgressLine = false;
48 return undefined;
49 }
50 if (event.type === 'test-step') {
51 if (!options.liveProgress) return undefined;
52 hasLiveProgressLine = true;
53 const spinnerFrame = nextReplayTestProgressSpinnerFrame(spinnerFrameIndex);
54 spinnerFrameIndex += 1;
55 return {
56 text: clearLinePrefix(
57 formatReplayTestLiveProgressLine(event.test, options, spinnerFrame),
58 ),
59 newline: false,
60 };
61 }
62 if (event.type !== 'test-result') return undefined;
63 if (isReplayTestCompletionProgressEvent(event.test)) {
64 const key = replayTestCompletionProgressKey(event.test);
65 if (completedKeys.has(key)) return undefined;
66 completedKeys.add(key);
67 }
68 const line = formatReplayTestProgressEvent(event.test, options);
69 if (!line) return undefined;
70 const text = hasLiveProgressLine ? clearLinePrefix(line) : line;
71 hasLiveProgressLine = false;
72 return { text, newline: true };
73 },
74 };
75}
76

Callers

nothing calls this directly

Tested by

no test coverage detected