feat: add initial project configuration and smoke tests
- 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.
This commit is contained in:
33
packages/api/src/prisma/__tests__/prisma.service.spec.ts
Normal file
33
packages/api/src/prisma/__tests__/prisma.service.spec.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user