demonsters / prisma-mock

A mock library of Prisma intended for unit testing.
MIT License
114 stars 28 forks source link

QueryRaw not working #69

Open castroCrea opened 1 month ago

castroCrea commented 1 month ago

Hello,

First off, great job on this library—it's been a lifesaver!

The issue:

In my code, I sometimes use the Prisma function queryRaw (documentation). Unfortunately, when I run tests with prisma-mock, queryRaw always returns undefined. From what I can tell, no one has reported this before, and it’s not mentioned in the documentation. Are there any plans to implement this?

stijnvanderlaan commented 1 month ago

This isn't possible at the moment, but you can take advantage of our use of jest-mock-extended by utilizing mockImplementation to mock the result yourself.