You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add tests for the WGC recorder process (src/wgcRecorder.ts, 0% coverage) #296
src/wgcRecorder.ts does frame slicing, wall-clock pacing, backpressure frame drops and has five exit paths, but has no tests. Only pure helpers in utils/wgc.ts are tested.
Fixed in 59e4eff. src/__tests__/integration/wgcRecorder.test.ts runs the built dist/wgcRecorder.js with an --import preload that replaces child_process.spawn with fake grab, encoder and nudge scripts written in Node. Because nothing real is captured, it runs on every CI leg.
All items on the checklist are covered:
"q" on stdin, closing stdin, and the stop file each end the recording with exit 0, a start banner, and roughly fps × seconds frames. The stop file is removed afterwards.
A window that closes after sending frames exits with WGC_WINDOW_CLOSED_EXIT.
A grab that fails before the first frame exits 1 with "capture failed".
If no frame arrives in time, it exits 1. The timeout is now injectable through WgcRecorderConfig.firstFrameTimeoutMs, which defaults to 10 s.
Frame bytes that arrive before the size line still split into whole frames. The fake encoder checks that every frame is uniform, so a frame split at the wrong byte would fail the test.
A stalled encoder causes frames to be dropped rather than queued.
maxDurationSec ends the recording.
On every exit path, no child process is left running.
These run in a child process, so they don't add line coverage for wgcRecorder.ts.
Activity
test: per-file coverage floors for the recording lifecycle (#302)
TMHSDigital commentedon Nov 10, 2026
Fixed in 59e4eff.
src/__tests__/integration/wgcRecorder.test.tsruns the builtdist/wgcRecorder.jswith an--importpreload that replaceschild_process.spawnwith fake grab, encoder and nudge scripts written in Node. Because nothing real is captured, it runs on every CI leg.All items on the checklist are covered:
WGC_WINDOW_CLOSED_EXIT.WgcRecorderConfig.firstFrameTimeoutMs, which defaults to 10 s.maxDurationSecends the recording.These run in a child process, so they don't add line coverage for
wgcRecorder.ts.