From 15e02635592fa1d1aa79eeb72f1945ae5ad1c341 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sat, 7 Dec 2024 10:26:15 +0100 Subject: [PATCH] Installation du module Nest Prisma --- server/src/app.module.ts | 3 ++- server/src/prisma/prisma.service.spec.ts | 18 ++++++++++++++++++ server/src/prisma/prisma.service.ts | 4 ++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 server/src/prisma/prisma.service.spec.ts create mode 100644 server/src/prisma/prisma.service.ts diff --git a/server/src/app.module.ts b/server/src/app.module.ts index d71dd70..ce6f8b3 100644 --- a/server/src/app.module.ts +++ b/server/src/app.module.ts @@ -1,10 +1,11 @@ import { Module } from '@nestjs/common' import { AppController } from './app.controller' import { AppService } from './app.service' +import { PrismaService } from './prisma/prisma.service' @Module({ imports: [], controllers: [AppController], - providers: [AppService], + providers: [AppService, PrismaService], }) export class AppModule {} diff --git a/server/src/prisma/prisma.service.spec.ts b/server/src/prisma/prisma.service.spec.ts new file mode 100644 index 0000000..229d3c2 --- /dev/null +++ b/server/src/prisma/prisma.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing' +import { PrismaService } from './prisma.service' + +describe('PrismaService', () => { + let service: PrismaService + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [PrismaService], + }).compile() + + service = module.get(PrismaService) + }) + + it('should be defined', () => { + expect(service).toBeDefined() + }) +}) diff --git a/server/src/prisma/prisma.service.ts b/server/src/prisma/prisma.service.ts new file mode 100644 index 0000000..ff36ace --- /dev/null +++ b/server/src/prisma/prisma.service.ts @@ -0,0 +1,4 @@ +import { Injectable } from '@nestjs/common' + +@Injectable() +export class PrismaService {}