test(jsonl): cover reusable decoder branches

This commit is contained in:
imccyu
2026-08-06 01:31:13 +08:00
parent 456d4319bf
commit 03bb663966
5 changed files with 147 additions and 20 deletions

View File

@@ -280,6 +280,7 @@ export class SessionPersistenceJsonl extends SessionPersistence implements Persi
signal?.throwIfAborted()
const headerFrame = decodedFrames.next()
signal?.throwIfAborted()
/* v8 ignore next -- a non-empty structural frame list makes the decoder yield its first frame or throw. */
if (headerFrame.done) throw new Error('empty or header-less Zstandard session log')
assertZstdHeaderFrame(headerFrame.value)
const scanner = new SessionLogScanner(headerFrame.value)