@@ -4,7 +4,7 @@ import { PrismaService } from '../prisma/prisma.service';
44import { TestRunsService } from '../test-runs/test-runs.service' ;
55import { EventsGateway } from '../shared/events/events.gateway' ;
66import { Build , TestRun , TestStatus } from '@prisma/client' ;
7- import { mocked } from 'jest-mock' ;
7+ import { mocked , MockedObject } from 'jest-mock' ;
88import { BuildDto } from './dto/build.dto' ;
99import { ProjectsService } from '../projects/projects.service' ;
1010import { generateTestRun } from '../_data_' ;
@@ -115,7 +115,7 @@ describe('BuildsService', () => {
115115 it ( 'findOne' , async ( ) => {
116116 const buildFindUniqueMock = jest . fn ( ) . mockResolvedValueOnce ( build ) ;
117117 const testRunFindManyMock = jest . fn ( ) . mockResolvedValueOnce ( build . testRuns ) ;
118- mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
118+ mocked ( BuildDto ) . mockReturnValueOnce ( buildDto as MockedObject < BuildDto > ) ;
119119 service = await initService ( { buildFindUniqueMock, testRunFindManyMock } ) ;
120120
121121 const result = await service . findOne ( 'someId' ) ;
@@ -128,7 +128,7 @@ describe('BuildsService', () => {
128128 const buildFindManyMock = jest . fn ( ) . mockResolvedValueOnce ( [ build ] ) ;
129129 const buildCountMock = jest . fn ( ) . mockResolvedValueOnce ( 33 ) ;
130130 const projectId = 'someId' ;
131- mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
131+ mocked ( BuildDto ) . mockReturnValueOnce ( buildDto as MockedObject < BuildDto > ) ;
132132 service = await initService ( { buildFindManyMock, buildCountMock } ) ;
133133
134134 const result = await service . findMany ( projectId , 10 , 20 ) ;
@@ -183,7 +183,7 @@ describe('BuildsService', () => {
183183 const id = 'some id' ;
184184 const buildUpdateMock = jest . fn ( ) ;
185185 const eventsBuildUpdatedMock = jest . fn ( ) ;
186- mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
186+ mocked ( BuildDto ) . mockReturnValueOnce ( buildDto as MockedObject < BuildDto > ) ;
187187 service = await initService ( { buildUpdateMock, eventsBuildUpdatedMock } ) ;
188188
189189 const result = await service . update ( id , { isRunning : false } ) ;
0 commit comments