You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm run test:ci src/service/prismaError.test.ts
> example-prj@1.4.0 test:ci
> DATABASE_URL="file:./test.db" jest "src/service/prismaError.test.ts"
FAIL src/service/prismaError.test.ts
Original PrismaClient
✓ handles prisma error properly (19 ms)
jestPrisma.client
✕ handles prisma error properly (144 ms)
● jestPrisma.client › handles prisma error properly
expect(received).toBeInstanceOf(expected)
Expected constructor: PrismaClientKnownRequestError
Received constructor: PrismaClientKnownRequestError
12 | });
13 | } catch (e) {
> 14 | expect(e).toBeInstanceOf(Prisma.PrismaClientKnownRequestError);
| ^
15 | }
16 | });
17 | });
at Object.<anonymous> (src/service/prismaError.test.ts:14:17)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 passed, 2 total
Snapshots: 0 total
Time: 3.502 s
It seems that the prisma error thrown via jestPrisma.client isn't recognized as an instanceof PrismaClientKnownRequestError properly (even though it shows a same name "PrismaClientKnownRequestError")
And this prevents us from handling prisma errors by the way the official document provides.
Do you have any idea on this?
Thanks!
The text was updated successfully, but these errors were encountered:
Thank you for the great library.
When I tried to add a following test into the
examples/example-prj/src/service
, I found a suspicious behavior.It seems that the prisma error thrown via jestPrisma.client isn't recognized as an
instanceof PrismaClientKnownRequestError
properly (even though it shows a same name "PrismaClientKnownRequestError")And this prevents us from handling prisma errors by the way the official document provides.
Do you have any idea on this?
Thanks!
The text was updated successfully, but these errors were encountered: