@@ -3,11 +3,11 @@ import path from 'path';
33import * as reportHelpers from '../report' ;
44import * as configHelpers from './config' ;
55
6- import { CliRunOptions , Config } from '../types' ;
6+ import type { CliRunOptions , Config } from '../types' ;
77import * as run from './run' ;
88import * as xcrun from '../utils/xcrun' ;
99import * as adb from '../utils/adb' ;
10- import execa from 'execa' ;
10+ import * as execa from 'execa' ;
1111import { Logger } from '../logger' ;
1212
1313jest . mock ( '../utils/xcrun' ) ;
@@ -21,9 +21,9 @@ describe('run.ts', () => {
2121 const mkdirMock = jest . spyOn ( fs , 'mkdir' ) ;
2222 const execKillMock = {
2323 kill : jest . fn ( ) ,
24- } as unknown as execa . ExecaChildProcess < any > ;
24+ } as unknown as ReturnType < typeof execa . execaCommand > ;
2525
26- const execMock = jest . spyOn ( execa , 'command ' ) . mockImplementation ( ) ;
26+ const execMock = jest . spyOn ( execa , 'execaCommand ' ) . mockReturnValue ( execKillMock ) ;
2727
2828 beforeEach ( ( ) => {
2929 mkdirMock . mockReset ( ) ;
@@ -153,7 +153,7 @@ describe('run.ts', () => {
153153 process . cwd ( )
154154 ) } --runInBand`;
155155
156- const commandSyncMock = jest . spyOn ( execa , 'commandSync ' ) ;
156+ const commandSyncMock = jest . spyOn ( execa , 'execaCommandSync ' ) ;
157157 const mockGenerateReport = jest . spyOn ( reportHelpers , 'generateReport' ) ;
158158
159159 jest . spyOn ( Logger . prototype , 'print' ) . mockImplementation ( ) ;
@@ -245,7 +245,7 @@ describe('run.ts', () => {
245245
246246 await run . runHandler ( { ...args } ) ;
247247
248- await expect ( execMock . mock . calls [ 0 ] [ 0 ] ) . toEqual (
248+ await expect ( execMock . mock . calls [ 0 ] ?. [ 0 ] ) . toEqual (
249249 'node scripts/websocket-server.js'
250250 ) ;
251251 } ) ;
0 commit comments