const zlib = require ( 'zlib' ) ; const fs = require ( 'fs' ) ; const path = require ( 'path' ) ; import { getTestClient } from '../../../../utils/getTestClient' ; jest . setTimeout ( 50000 ) ; test ( 'sqlite-variable-limit' , async ( ) => { const PrismaClient = await getTestClient ( ) ; const prisma = new PrismaClient ( ) ; const db = path . join ( __dirname , 'dev.db' ) ; if ( ! fs . existsSync ( db ) ) { await uncompressFile ( db ) ; } await prisma . user . findMany ( { include : { posts : true , } , } ) ; await prisma . $disconnect ( ) ; } ) ; async function uncompressFile ( filename ) { return new Promise < void > ( ( resolve , reject ) => { const decompress = zlib . createBrotliDecompress ( ) ; const input = fs . createReadStream ( filename + '.br' ) ; const output = fs . createWriteStream ( filename ) ; input . pipe ( decompress ) . pipe ( output ) ; output . on ( 'finish' , ( ) => { resolve ( ) ; } ) ; output . on ( 'error' , ( ex ) => { reject ( ex ) ; } ) ; } ) ; }