Do we have a proper unit testing guide for prisma?
# orm-help
s
Do we have a proper unit testing guide for prisma?
r
Hi @Salman Shaikh 👋 You can have a look here.
👀 1
s
Thanks buddy
I am getting a circular dependency error after following the guide
When I do
prismaMock.user.
anything
r
Have you added
"strictNullChecks": true
to your
tsconfig.json
file?
s
I did
But it's still giving error
Copy code
Details:
 
     /Users/salmanshaikh/westfield/one-visitor-api/src/modules/user/̉user.repository.test.ts:1
     ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { create } from './user.repository.js';
                                                                                       ^^^^^^
 
     SyntaxError: Cannot use import statement outside a module
 
       at Runtime.createScriptFromCode (../node_modules/jest-runtime/build/index.js:1796:14)
While running tests
r
This is a different error from the previous one.
s
The circular dependency error is coming only while writing the code in intellisense. This one comes when I try to run it
r
Can you try this fix recommended here?
s
I have
type: module
in my package.json and tsconfig
Thanks for the help man. It works after installing
ts-jest
you guys should add it to the guide I guess
Now I have a foreign key issue. Can we skip foreign key checks while testing?