({ read, active = true, paused = false }: { read: () => Promise<number>; active?: boolean; paused?: boolean })
| 9 | let visibility: DocumentVisibilityState; |
| 10 | let mounted: boolean; |
| 11 | function Harness({ read, active = true, paused = false }: { read: () => Promise<number>; active?: boolean; paused?: boolean }) { |
| 12 | const reading = useSystemPoll(read, active, paused, 100); |
| 13 | return <><output>{JSON.stringify(reading)}</output><button onClick={reading.refresh}>Refresh</button></>; |
| 14 | } |
| 15 | const state = () => JSON.parse(container.querySelector('output')?.textContent ?? '{}'); |
| 16 | const render = async (read: () => Promise<number>, active = true, paused = false) => { |
| 17 | await act(async () => { root.render(<Harness read={read} active={active} paused={paused} />); }); |
nothing calls this directly
no test coverage detected