anyone have tips on getting started writing unit t...
# orm-help
j
anyone have tips on getting started writing unit tests that involve prisma? ideally with jest
plus one +1 1
👀 1
u
use this. you test will be smooth then.
Copy code
describe(' user category ', () => {
  beforeAll(async () => {
    await prisma.$connect();
  });
  
  afterAll(async function () {
    await prisma.$disconnect();
  });
});
s
what version of prisma are you using?
Do you have a working project?
u
newest version
I was encountering errors at first. so I use a single prisma instance with connect and disconnet.
👍 1
and jest test works now.