@@ -4,7 +4,6 @@ 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 'ts-jest/utils' ;
87import { BuildDto } from './dto/build.dto' ;
98import { ProjectsService } from '../projects/projects.service' ;
109import { generateTestRun } from '../_data_' ;
@@ -115,20 +114,20 @@ describe('BuildsService', () => {
115114 it ( 'findOne' , async ( ) => {
116115 const buildFindUniqueMock = jest . fn ( ) . mockResolvedValueOnce ( build ) ;
117116 const testRunFindManyMock = jest . fn ( ) . mockResolvedValueOnce ( build . testRuns ) ;
118- mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
117+ jest . mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
119118 service = await initService ( { buildFindUniqueMock, testRunFindManyMock } ) ;
120119
121120 const result = await service . findOne ( 'someId' ) ;
122121
123- expect ( mocked ( BuildDto ) ) . toHaveBeenCalledWith ( { ...build , testRuns : build . testRuns } ) ;
122+ expect ( jest . mocked ( BuildDto ) ) . toHaveBeenCalledWith ( { ...build , testRuns : build . testRuns } ) ;
124123 expect ( result ) . toBe ( buildDto ) ;
125124 } ) ;
126125
127126 it ( 'findMany' , async ( ) => {
128127 const buildFindManyMock = jest . fn ( ) . mockResolvedValueOnce ( [ build ] ) ;
129128 const buildCountMock = jest . fn ( ) . mockResolvedValueOnce ( 33 ) ;
130129 const projectId = 'someId' ;
131- mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
130+ jest . mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
132131 service = await initService ( { buildFindManyMock, buildCountMock } ) ;
133132
134133 const result = await service . findMany ( projectId , 10 , 20 ) ;
@@ -183,7 +182,7 @@ describe('BuildsService', () => {
183182 const id = 'some id' ;
184183 const buildUpdateMock = jest . fn ( ) ;
185184 const eventsBuildUpdatedMock = jest . fn ( ) ;
186- mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
185+ jest . mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
187186 service = await initService ( { buildUpdateMock, eventsBuildUpdatedMock } ) ;
188187
189188 const result = await service . update ( id , { isRunning : false } ) ;
0 commit comments