Writing integration tests injecting data for the t...
# orm-help
w
Writing integration tests injecting data for the test in a
beforeAll
using prisma-client:
Copy code
let user;
beforeAll(async () => {
  user = await prisma.createUser({
    name: 'John'
  });
});

test('stuff', () => {
  const res = doStuffWithUser(user);
  expect(res)...
});
good idea or not? Right now I’m creating data manually for each test and reloading database on each test run
l
Maybe think of seeding the data with
prisma seed
separately for your tests. Then you wouldn’t need to create the data in your test files