import { PrismaClient } from '.' ; import { expectError , expectType } from 'tsd' ; const prisma = new PrismaClient ( { datasources : { db : { url : 'file:dev.db' , } , } , } ) ; ( async ( ) => { expectError ( await prisma . user . findMany ( { include : { _count : { select : { asd : true , } , } , } , } ) ) ; { const users = await prisma . user . findMany ( ) ; expectError ( users [ 0 ] . _count . posts ) ; } { const users = await prisma . user . findMany ( { include : { _count : false , } , } ) ; expectError ( users [ 0 ] . _count . posts ) ; } { const users = await prisma . user . findMany ( { include : { _count : true , } , } ) ; expectType < number > ( users [ 0 ] . _count . posts ) ; } } ) ( ) ;