5050 */
5151
5252import { describe , it , expect , beforeAll , afterAll , vi } from 'vitest' ;
53+ import type { EngineAggregateOptions , EngineQueryOptions } from '@objectstack/spec/data' ;
5354import { ObjectQL } from '@objectstack/objectql' ;
5455import { SqlDriver , withheldFilterDiagnosticOf } from '@objectstack/driver-sql' ;
5556import { ObjectStackProtocolImplementation } from '@objectstack/metadata-protocol' ;
@@ -139,7 +140,8 @@ describe('[#20981] a non-boolean $exists / $null in a per-aggregation filter or
139140 /** The `where` twin's refusal, thrown by `driver-sql`, and the diagnostic it keeps server-side. */
140141 async function whereTwinDiagnostic ( op : string , comparand : unknown ) : Promise < string > {
141142 try {
142- await engine . find ( OBJECT , { where : { name : { [ op ] : comparand } } } as any ) ;
143+ // Deliberately off-contract: the flag is not a boolean.
144+ await engine . find ( OBJECT , { where : { name : { [ op ] : comparand } } } as unknown as EngineQueryOptions ) ;
143145 } catch ( err ) {
144146 expect ( ( err as { code ?: string } ) . code ) . toBe ( 'INVALID_FILTER' ) ;
145147 const diagnostic = withheldFilterDiagnosticOf ( err ) ;
@@ -152,7 +154,8 @@ describe('[#20981] a non-boolean $exists / $null in a per-aggregation filter or
152154 /** The engine's full message, thrown before any row is read. */
153155 async function engineRefusal ( body : Record < string , unknown > ) : Promise < Error & { code ?: string ; status ?: number } > {
154156 try {
155- await engine . aggregate ( OBJECT , body as any ) ;
157+ // Deliberately off-contract: the flag is not a boolean.
158+ await engine . aggregate ( OBJECT , body as unknown as EngineAggregateOptions ) ;
156159 } catch ( err ) {
157160 return err as Error & { code ?: string ; status ?: number } ;
158161 }
0 commit comments