@@ -4,7 +4,6 @@ import { PrismaService } from '../prisma/prisma.service';
4
4
import { TestRunsService } from '../test-runs/test-runs.service' ;
5
5
import { EventsGateway } from '../shared/events/events.gateway' ;
6
6
import { Build , TestRun , TestStatus } from '@prisma/client' ;
7
- import { mocked } from 'ts-jest/utils' ;
8
7
import { BuildDto } from './dto/build.dto' ;
9
8
import { ProjectsService } from '../projects/projects.service' ;
10
9
import { generateTestRun } from '../_data_' ;
@@ -115,20 +114,20 @@ describe('BuildsService', () => {
115
114
it ( 'findOne' , async ( ) => {
116
115
const buildFindUniqueMock = jest . fn ( ) . mockResolvedValueOnce ( build ) ;
117
116
const testRunFindManyMock = jest . fn ( ) . mockResolvedValueOnce ( build . testRuns ) ;
118
- mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
117
+ jest . mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
119
118
service = await initService ( { buildFindUniqueMock, testRunFindManyMock } ) ;
120
119
121
120
const result = await service . findOne ( 'someId' ) ;
122
121
123
- expect ( mocked ( BuildDto ) ) . toHaveBeenCalledWith ( { ...build , testRuns : build . testRuns } ) ;
122
+ expect ( jest . mocked ( BuildDto ) ) . toHaveBeenCalledWith ( { ...build , testRuns : build . testRuns } ) ;
124
123
expect ( result ) . toBe ( buildDto ) ;
125
124
} ) ;
126
125
127
126
it ( 'findMany' , async ( ) => {
128
127
const buildFindManyMock = jest . fn ( ) . mockResolvedValueOnce ( [ build ] ) ;
129
128
const buildCountMock = jest . fn ( ) . mockResolvedValueOnce ( 33 ) ;
130
129
const projectId = 'someId' ;
131
- mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
130
+ jest . mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
132
131
service = await initService ( { buildFindManyMock, buildCountMock } ) ;
133
132
134
133
const result = await service . findMany ( projectId , 10 , 20 ) ;
@@ -183,7 +182,7 @@ describe('BuildsService', () => {
183
182
const id = 'some id' ;
184
183
const buildUpdateMock = jest . fn ( ) ;
185
184
const eventsBuildUpdatedMock = jest . fn ( ) ;
186
- mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
185
+ jest . mocked ( BuildDto ) . mockReturnValueOnce ( buildDto ) ;
187
186
service = await initService ( { buildUpdateMock, eventsBuildUpdatedMock } ) ;
188
187
189
188
const result = await service . update ( id , { isRunning : false } ) ;
0 commit comments