Demon1212122's picture
chore: reapply local updates
fb14972
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();