refactor(server): import prisma from @prisma/client (#5863)

This commit is contained in:
liuyi
2024-02-22 07:46:57 +00:00
parent f2c5786dd0
commit 4d421a324f
24 changed files with 82 additions and 218 deletions

View File

@@ -4,14 +4,13 @@ import { randomUUID } from 'node:crypto';
import { Transformer } from '@napi-rs/image';
import type { INestApplication } from '@nestjs/common';
import { hashSync } from '@node-rs/argon2';
import { type User } from '@prisma/client';
import { PrismaClient, type User } from '@prisma/client';
import ava, { type TestFn } from 'ava';
import type { Express } from 'express';
import request from 'supertest';
import { AppModule } from '../src/app.module';
import { FeatureManagementService } from '../src/core/features';
import { PrismaService } from '../src/fundamentals/prisma';
import { createTestingApp } from './utils';
const gql = '/graphql';
@@ -52,7 +51,7 @@ test.beforeEach(async t => {
imports: [AppModule],
tapModule(builder) {
builder
.overrideProvider(PrismaService)
.overrideProvider(PrismaClient)
.useClass(FakePrisma)
.overrideProvider(FeatureManagementService)
.useValue({ canEarlyAccess: () => true });