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
Cleaning up a scenario after a test will fail and thus fail the test if you are using the Prisma multiple schema preview. You'll get something like:
PrismaClientKnownRequestError:
Invalid `prisma.$executeRawUnsafe()` invocation:
Raw query failed. Code: `42P01`. Message: `relation "state" does not exist`
at Rn.handleRequestError (node_modules/@prisma/client/runtime/library.js:174:7325)
at Rn.handleAndLogRequestError (node_modules/@prisma/client/runtime/library.js:174:6754)
at Rn.request (node_modules/@prisma/client/runtime/library.js:174:6344)
at teardown (node_modules/@redwoodjs/testing/config/jest/api/jest.setup.js:143:7)
at Object.<anonymous> (node_modules/@redwoodjs/testing/config/jest/api/jest.setup.js:237:5)
Your postgresql.log, if you have one, will show
2023-07-31 13:57:46.037 CDT [77866] calypso@calypso_test ERROR: relation "state" does not exist at character 13
2023-07-31 13:57:46.037 CDT [77866] calypso@calypso_test STATEMENT: DELETE FROM "state"
Since it's a preview this is half feature request half bug (it's a feature request because it's not supported; it's a bug because it fails gracelessly).
What's not working?
Cleaning up a scenario after a test will fail and thus fail the test if you are using the Prisma multiple schema preview. You'll get something like:
Your
postgresql.log
, if you have one, will showSince it's a preview this is half feature request half bug (it's a feature request because it's not supported; it's a bug because it fails gracelessly).
I'm pretty sure this is because of jest.setup.js:144
I found this in
5.4.3
, but the above code is from the6.0.1
tag.Prisma's info from the original issue and docs on the preview feature.
The workaround is pretty easy. In your
.env
set the schema search path via the connection string:You need the
%20
exactly as that otherwise the driver gets confused (no problem with the second=
though ¯_(ツ)_/¯ )How do we reproduce the bug?
In a
schema.prisma
like so:Create a jest test using a scenario with data using
State
, e.g.:Create a test using the scenario:
You will get the errors described above.
What's your environment? (If it applies)
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: