© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•8mo ago•
4 replies
YonoZekenZoid

getting a typescript error when trying to use drizzle.mock()

I'm trying to mock my drizzle driver for some unit tests. I'm using
drizzle.mock()
drizzle.mock()
. When I pass it into the function that takes it, I get the following error:

Argument of type
NodePgDatabase<Record<string, never>> & {
    $client: "$client is not available on drizzle.mock()";
}
is not assignable to parameter of type
NodePgDatabase<typeof import("/home/nico/src/idem/packages/backend/src/db/schema")> & {
    $client: Pool;
}
Type
NodePgDatabase<Record<string, never>> & {
    $client: "$client is not available on drizzle.mock()";
}
is not assignable to type
NodePgDatabase<typeof import("/home/nico/src/idem/packages/backend/src/db/schema")>
Argument of type
NodePgDatabase<Record<string, never>> & {
    $client: "$client is not available on drizzle.mock()";
}
is not assignable to parameter of type
NodePgDatabase<typeof import("/home/nico/src/idem/packages/backend/src/db/schema")> & {
    $client: Pool;
}
Type
NodePgDatabase<Record<string, never>> & {
    $client: "$client is not available on drizzle.mock()";
}
is not assignable to type
NodePgDatabase<typeof import("/home/nico/src/idem/packages/backend/src/db/schema")>


I tried to modify the property, to have a null pool, but I get another error telling me that type Pool isn't compatible with the prop's type.

how do I mock the driver? I've been at it for the past couple of days and am super confused 😖
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

typescript error when trying to update a column
Drizzle TeamDTDrizzle Team / help
11mo ago
Wierd error when trying to run drizzle studio
Drizzle TeamDTDrizzle Team / help
3y ago
error when trying to run drizzle-kit push:pg
Drizzle TeamDTDrizzle Team / help
3y ago
Using drizzle with a DI container - which type to use? Getting error
Drizzle TeamDTDrizzle Team / help
2y ago