Patrick
07/30/2021, 2:39 PMasync getUserByMail(email: string): Promise<User | null> {
// return this.prisma.user.findUnique({ where: { email } }); // <- this works
// this fails in unit tests:
return this.prisma.user.findFirst({
where: {
email: {
equals: email,
mode: 'insensitive',
},
},
});
}
Anybody knows what the issue could be? findUnique
works fine, but I need to find the mail case insensitive and findUnique
doesnt seem to support this.Ryan
07/30/2021, 3:01 PMprisma
and @prisma/client
are you on?Patrick
07/30/2021, 3:03 PM2.17.0
as well as 2.28.0
Ryan
07/30/2021, 3:09 PMPatrick
07/30/2021, 3:31 PM2.28.0
for @prisma/client
and prisma
packages and made a fresh npx prisma generate
but without success. Maybe this is some quirk with jest
and ts-jest
but I can't wrap my head around whats wrong as the corresponding generated type files have the function availablePatrick
07/30/2021, 3:51 PM