test(native-chat): type the stalled snapshot drain without a cast

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Brennan Benson
2026-09-24 23:57:28 -07:00
co-authored by Claude
parent 3cbf6b58f4
commit e048579cf5
@@ -101,12 +101,7 @@ describe('structured agent session eviction', () => {
const snapshot = vi.fn()
ctx.beforeProviderChildStop = snapshot
// A journal write that never settles, then a healthy sink once the child is stopped.
ctx.eventSink.drained = vi
.fn()
.mockReturnValueOnce(new Promise(() => {}))
.mockResolvedValue({
ok: true
}) as unknown as StructuredAgentSessionEvictionContext['eventSink']['drained']
vi.mocked(ctx.eventSink.drained).mockReturnValueOnce(new Promise<never>(() => {}))
const eviction = evictStructuredAgentSession(ctx)
await vi.advanceTimersByTimeAsync(1_000)