- Created pnpm workspace configuration to manage packages. - Added a placeholder .gitkeep file in the scripts directory. - Implemented a smoke test script to validate core API and web endpoints. - Established TypeScript base configuration for consistent compilation settings. - Introduced Turbo configuration for task management and build processes.
34 lines
973 B
TypeScript
34 lines
973 B
TypeScript
import { Test, TestingModule } from '@nestjs/testing';
|
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
import { PrismaService } from '../prisma.service.js';
|
|
import { ConfigService } from '@nestjs/config';
|
|
|
|
describe('PrismaService', () => {
|
|
let service: PrismaService;
|
|
|
|
beforeEach(async () => {
|
|
const module: TestingModule = await Test.createTestingModule({
|
|
providers: [
|
|
PrismaService,
|
|
{
|
|
provide: ConfigService,
|
|
useValue: {
|
|
getOrThrow: vi.fn().mockReturnValue('postgresql://test:test@localhost:5432/test'),
|
|
},
|
|
},
|
|
],
|
|
}).compile();
|
|
|
|
service = module.get<PrismaService>(PrismaService);
|
|
});
|
|
|
|
it('should be defined', () => {
|
|
expect(service).toBeDefined();
|
|
});
|
|
|
|
it('should expose PrismaClient methods directly (extends pattern)', () => {
|
|
expect(typeof service.$connect).toBe('function');
|
|
expect(typeof service.$disconnect).toBe('function');
|
|
});
|
|
});
|