From d64f688459e810c93c97deb11374d3ce38b8e4e1 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 12 Oct 2026 01:08:44 +0200 Subject: [PATCH] test fixes: the grey-image schema is a custom check, and the pack probe treats a throwing result as not a reader Fixes the previous commit (05f9937b, mislabelled wip): its test file did not compile (TS2322) and the pack probe threw on a lazy codec's getters. Co-Authored-By: Claude Sonnet 5.5 --- scripts/test-typescript-package-closure.mjs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/test-typescript-package-closure.mjs b/scripts/test-typescript-package-closure.mjs index 914cf8cf..c71101b5 100644 --- a/scripts/test-typescript-package-closure.mjs +++ b/scripts/test-typescript-package-closure.mjs @@ -124,10 +124,11 @@ for (const [entryName, entry] of Object.entries(entries)) { assert.notEqual(value, reader, entryName + " entry exports " + name + " as " + where); } if (typeof value !== "function" || value === cache.decodeDocumentPayload) continue; - let returned; - try { returned = value(probePayload); } catch { continue; } - assert.ok(!JSON.stringify(returned, (_key, member) => (member instanceof Map ? Object.fromEntries(member) : member))?.includes('"probe":7'), - entryName + " entry exports " + where + ", which reads a payload without its schema"); + let shown; + try { + shown = JSON.stringify(value(probePayload), (_key, member) => (member instanceof Map ? Object.fromEntries(member) : member)); + } catch { continue; } + assert.ok(!shown?.includes('"probe":7'), entryName + " entry exports " + where + ", which reads a payload without its schema"); } } assert.equal(typeof documentEntry.checkPayloadDepth, "undefined");