fix prisma health tests
This commit is contained in:
parent
be529c111a
commit
47e4abf594
|
@ -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,
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue