fix prisma health tests

This commit is contained in:
sbriat 2023-05-04 10:11:19 +02:00
parent be529c111a
commit 47e4abf594
1 changed files with 5 additions and 5 deletions

View File

@ -1,10 +1,10 @@
import { Test, TestingModule } from '@nestjs/testing'; import { Test, TestingModule } from '@nestjs/testing';
import { PrismaHealthIndicatorUseCase } from '../../domain/usecases/prisma.health-indicator.usecase'; import { PrismaHealthIndicatorUseCase } from '../../domain/usecases/prisma.health-indicator.usecase';
import { UsersRepository } from '../../../user/adapters/secondaries/users.repository';
import { PrismaClientKnownRequestError } from '@prisma/client/runtime';
import { HealthCheckError, HealthIndicatorResult } from '@nestjs/terminus'; import { HealthCheckError, HealthIndicatorResult } from '@nestjs/terminus';
import { AdsRepository } from '../../../ad/adapters/secondaries/ads.repository';
import { PrismaClientKnownRequestError } from '@prisma/client/runtime/library';
const mockUsersRepository = { const mockAdsRepository = {
healthCheck: jest healthCheck: jest
.fn() .fn()
.mockImplementationOnce(() => { .mockImplementationOnce(() => {
@ -25,8 +25,8 @@ describe('PrismaHealthIndicatorUseCase', () => {
const module: TestingModule = await Test.createTestingModule({ const module: TestingModule = await Test.createTestingModule({
providers: [ providers: [
{ {
provide: UsersRepository, provide: AdsRepository,
useValue: mockUsersRepository, useValue: mockAdsRepository,
}, },
PrismaHealthIndicatorUseCase, PrismaHealthIndicatorUseCase,
], ],