@@ -13,7 +13,11 @@ vi.mock("~/db.server", () => ({
1313 sqlDatabaseSchema : Prisma . sql ( [ "public" ] ) ,
1414} ) ) ;
1515
16- import { heteroPostgresTest , heteroRunOpsPostgresTest , postgresTest } from "@internal/testcontainers" ;
16+ import {
17+ heteroPostgresTest ,
18+ heteroRunOpsPostgresTest ,
19+ postgresTest ,
20+ } from "@internal/testcontainers" ;
1721import { PrismaClient } from "@trigger.dev/database" ;
1822import { RunOpsPrismaClient } from "@internal/run-ops-database" ;
1923import {
@@ -34,7 +38,12 @@ type SeedContext = {
3438// against a direct $queryRaw of the identical SQL on each DB version.
3539function rawScan (
3640 prisma : PrismaClient ,
37- opts : { environmentId : string ; pageSize : number ; direction : "forward" | "backward" ; cursor ?: string }
41+ opts : {
42+ environmentId : string ;
43+ pageSize : number ;
44+ direction : "forward" | "backward" ;
45+ cursor ?: string ;
46+ }
3847) {
3948 const { environmentId, pageSize, direction, cursor } = opts ;
4049 const sqlDatabaseSchema = Prisma . sql ( [ "public" ] ) ;
@@ -178,7 +187,10 @@ async function createBatch(
178187 } ) ;
179188}
180189
181- const baseCall = ( ctx : SeedContext , overrides : Partial < BatchListOptions > = { } ) : BatchListOptions => ( {
190+ const baseCall = (
191+ ctx : SeedContext ,
192+ overrides : Partial < BatchListOptions > = { }
193+ ) : BatchListOptions => ( {
182194 projectId : ctx . projectId ,
183195 environmentId : ctx . environmentId ,
184196 userId : ctx . userId ,
@@ -201,7 +213,8 @@ function spyClient(
201213 if ( trProp === "findMany" ) {
202214 return ( ...args : any [ ] ) => {
203215 counts . findMany ++ ;
204- if ( opts . throwOnQueryRaw ) throw new Error ( "batchTaskRun.findMany must not be invoked on this handle" ) ;
216+ if ( opts . throwOnQueryRaw )
217+ throw new Error ( "batchTaskRun.findMany must not be invoked on this handle" ) ;
205218 return ( trTarget as any ) . findMany ( ...args ) ;
206219 } ;
207220 }
@@ -286,7 +299,11 @@ describe("BatchListPresenter run-ops read routing (PG14 control-plane/legacy + P
286299 // The TS codepoint comparator reproduces the DB ORDER BY over the seeded id set.
287300 const allIds = ids . map ( ( i ) => `batch_${ i } ` ) ;
288301 const dbForward = (
289- await rawScan ( prisma17 , { environmentId : ctx17 . environmentId , pageSize : 50 , direction : "forward" } )
302+ await rawScan ( prisma17 , {
303+ environmentId : ctx17 . environmentId ,
304+ pageSize : 50 ,
305+ direction : "forward" ,
306+ } )
290307 ) . map ( ( r ) => r . id ) ;
291308 expect ( dbForward ) . toEqual ( [ ...allIds ] . sort ( desc ) ) ;
292309 }
@@ -389,7 +406,9 @@ describe("BatchListPresenter run-ops read routing (PG14 control-plane/legacy + P
389406 expect ( page . hasAnyBatches ) . toBe ( true ) ;
390407
391408 // Now wipe legacy too => both empty => hasAnyBatches false.
392- await prisma14 . batchTaskRun . deleteMany ( { where : { runtimeEnvironmentId : ctx . environmentId } } ) ;
409+ await prisma14 . batchTaskRun . deleteMany ( {
410+ where : { runtimeEnvironmentId : ctx . environmentId } ,
411+ } ) ;
393412 const page2 = await presenter . call ( baseCall ( ctx , { friendlyId : "fr_does_not_exist" } ) ) ;
394413 expect ( page2 . batches ) . toHaveLength ( 0 ) ;
395414 expect ( page2 . hasAnyBatches ) . toBe ( false ) ;
0 commit comments