test: integrate cypress
This commit is contained in:
parent
3a4695bc03
commit
781e25909d
21 changed files with 1396 additions and 39 deletions
29
cypress/e2e/seed.ts
Normal file
29
cypress/e2e/seed.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
import { PrismaClient } from '../../src/generated/prisma';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
export default async function requireUser() {
|
||||
await prisma.$transaction(async (tx) => {
|
||||
const { id } = await tx.user.create({
|
||||
data: {
|
||||
email: 'cypress@example.com',
|
||||
name: 'cypress',
|
||||
password_hash:
|
||||
'$2a$10$FmkVRHXzMb63dLHHwG1mDOepZJirL.U964wU/3Xr7cFis8XdRh8sO',
|
||||
first_name: 'Cypress',
|
||||
last_name: 'Tester',
|
||||
emailVerified: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
await tx.account.create({
|
||||
data: {
|
||||
userId: id,
|
||||
type: 'credentials',
|
||||
provider: 'credentials',
|
||||
providerAccountId: id,
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
requireUser();
|
Loading…
Add table
Add a link
Reference in a new issue