Skip to content

Commit bb3e246

Browse files
committed
test(sql-orm-client): bypass type gate in required-payload runtime-guard tests
The type-level .create/.connect disable (now in dist after the main rebase) makes those calls compile errors; cast the args to `never` to still exercise the runtime guard on a real DB (defense-in-depth). Surfaced by rebuilding against origin/main. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
1 parent 0012d4b commit bb3e246

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

test/integration/test/sql-orm-client/mn-nested-write.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,10 @@ describe('integration/mn-nested-write', () => {
308308
id: 1,
309309
name: 'Alice',
310310
email: 'alice@example.com',
311-
roles: (r) => r.create([{ id: ROLE_ADMIN, name: 'Admin' }]),
311+
// The type gate forbids `create` on a required-payload junction at
312+
// compile time; cast the arg to bypass it and exercise the runtime
313+
// guard (defense-in-depth) against a real database.
314+
roles: (r) => r.create([{ id: ROLE_ADMIN, name: 'Admin' }] as never),
312315
}),
313316
).rejects.toThrow(/required column.*`level`/);
314317
});
@@ -333,7 +336,10 @@ describe('integration/mn-nested-write', () => {
333336
id: 1,
334337
name: 'Alice',
335338
email: 'alice@example.com',
336-
roles: (r) => r.connect({ id: ROLE_ADMIN }),
339+
// The type gate forbids `connect` on a required-payload junction at
340+
// compile time; cast the arg to bypass it and exercise the runtime
341+
// guard (defense-in-depth).
342+
roles: (r) => r.connect({ id: ROLE_ADMIN } as never),
337343
}),
338344
).rejects.toThrow(/required column.*`level`/);
339345
});

0 commit comments

Comments
 (0)