windkomo
02/26/2019, 9:43 PMbeforeAll
using prisma-client:
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 runLotafak
02/27/2019, 7:32 AMprisma seed
separately for your tests. Then you wouldn’t need to create the data in your test files