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