import { PrismaClient } from '@prisma/client'; import * as dotenv from 'dotenv'; dotenv.config(); const prisma = new PrismaClient(); async function smokeTest() { console.log('๐Ÿงช Starting smoke test...'); try { // Test user const user = await prisma.user.findFirst(); if (!user) { throw new Error('User not found'); } console.log('โœ… User verified:', user.email); // Test session const session = await prisma.session.findFirst(); if (!session) { throw new Error('Session not found'); } console.log('โœ… Session verified'); // Test conversation and message const conversation = await prisma.conversation.findFirst({ include: { messages: true } }); if (!conversation || !conversation.messages.length) { throw new Error('Conversation or messages not found'); } console.log('โœ… Conversation and messages verified'); // Test suggestion const suggestion = await prisma.suggestion.findFirst(); if (!suggestion) { throw new Error('Suggestion not found'); } console.log('โœ… Suggestion verified'); console.log('โœ… All smoke tests passed!'); } catch (error) { console.error('โŒ Smoke test failed:', error); process.exit(1); } finally { await prisma.$disconnect(); } } smokeTest();