Skip to content

Commit 42713d2

Browse files
committed
test(service-storage): the #24366 pin fixture's WHERE matcher refuses unknown operators loudly
The in-memory matcher now throws on an unsupported combinator or operator rather than silently excluding the row, as check:where-matcher requires. Claude-Session: https://claude.ai/code/session_01Nk17Z26X5DB59iQztDBADH Co-authored-by: Claude <noreply@anthropic.com>
1 parent d07c6bd commit 42713d2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/services/service-storage/src/storage-routes.family-gate-credential.pin.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ function services(sessionReads: { n: number }) {
9898
};
9999
const matches = (row: Record<string, unknown>, where: Record<string, unknown> | undefined) =>
100100
Object.entries(where ?? {}).every(([k, v]) => {
101+
if (k.startsWith('$')) throw new Error(`fixture: unsupported combinator ${k}`);
101102
if (v !== null && typeof v === 'object') {
102103
const list = (v as { $in?: unknown[] }).$in;
103-
return Array.isArray(list) ? list.includes(row[k]) : false;
104+
if (!Array.isArray(list)) throw new Error(`fixture: unsupported operator on ${k}`);
105+
return list.includes(row[k]);
104106
}
105107
return (v ?? null) === (row[k] ?? null);
106108
});

0 commit comments

Comments
 (0)