MeetUp/cypress/e2e/seed.ts
Dominik Stahl 4c6e66c1a2
Some checks failed
container-scan / Container Scan (pull_request) Successful in 5m58s
docker-build / docker (pull_request) Successful in 5m57s
tests / Tests (pull_request) Failing after 7m21s
test: integrate cypress
2025-06-25 14:24:23 +02:00

29 lines
712 B
TypeScript

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();