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
I tried to set up the jest-prisma environment with a Blitz.js app, following the documentation, but encountered an issue where jestPrisma is not defined in the test environment.
"compilerOptions": {
// other configurations
"types": ["@types/jest", "@quramy/jest-prisma"]
}
the test I wrote
describe("jest-prisma test",()=>{
it("should be able to use jest-prisma",async()=>{
const data = {
name:"test venue",
email: '1@example.com'
}
await jestPrisma.client.user.create({
data,
})
const result = await jestPrisma.client.user.findMany()
expect(result).toEqual([data])
})
})
Expected Behavior
jestPrisma should be provided as a global object and the test should run without issues.
Actual Behavior
I encountered a ReferenceError when running the test:
Description
I tried to set up the jest-prisma environment with a Blitz.js app, following the documentation, but encountered an issue where jestPrisma is not defined in the test environment.
Code and Configuration
jest.config.js
tsconfig.js
the test I wrote
Expected Behavior
jestPrisma should be provided as a global object and the test should run without issues.
Actual Behavior
I encountered a ReferenceError when running the test:
Version Info
@prisma/client: 3.9.2 (Using previewFeatures: ["interactiveTransactions", "referentialActions"])
blitz: 0.44.3
Node.js: 14.21.3
OS: Mac 12.6
The text was updated successfully, but these errors were encountered: