Initial commit: full-stack Bun + Elysia + React template
Elysia.js API with session-based auth (email/password + Google OAuth), role system (USER/ADMIN/SUPER_ADMIN), Prisma + PostgreSQL, React 19 with Mantine UI, TanStack Router, dark theme, and comprehensive test suite (unit, integration, E2E with Lightpanda). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
23
tests/unit/db.test.ts
Normal file
23
tests/unit/db.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { test, expect, describe, afterAll } from 'bun:test'
|
||||
import { prisma } from '../helpers'
|
||||
|
||||
afterAll(async () => {
|
||||
await prisma.$disconnect()
|
||||
})
|
||||
|
||||
describe('Prisma database connection', () => {
|
||||
test('connects to database', async () => {
|
||||
const result = await prisma.$queryRaw`SELECT 1 as ok`
|
||||
expect(result).toEqual([{ ok: 1 }])
|
||||
})
|
||||
|
||||
test('user table exists', async () => {
|
||||
const count = await prisma.user.count()
|
||||
expect(typeof count).toBe('number')
|
||||
})
|
||||
|
||||
test('session table exists', async () => {
|
||||
const count = await prisma.session.count()
|
||||
expect(typeof count).toBe('number')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user