@@ -302,5 +302,34 @@ describe('run.ts', () => {
302302 await expect ( mockGenerateReport ) . not . toHaveBeenCalled ( ) ;
303303 }
304304 } ) ;
305+
306+ it ( 'runs with a specific testPathPattern' , async ( ) => {
307+ jest . spyOn ( configHelpers , 'getConfig' ) . mockResolvedValueOnce ( config ) ;
308+ const mockRunIOS = jest . spyOn ( run , 'runIOS' ) . mockResolvedValueOnce ( ) ;
309+
310+ const testPathPattern = '*' ;
311+ await run . runHandler ( { ...args , testPathPattern } ) ;
312+
313+ await expect ( mockRunIOS ) . toHaveBeenCalled ( ) ;
314+ await expect ( commandSyncMock ) . toHaveBeenCalledTimes ( 1 ) ;
315+ await expect ( commandSyncMock ) . toHaveBeenCalledWith (
316+ `${ expectedJestCommand } --globals='{\"OWL_CLI_ARGS\":{\"platform\":\"ios\",\"config\":\"./owl.config.json\",\"update\":false,\"testPathPattern\":\"${ testPathPattern } \"}}' --testPathPattern="${ testPathPattern } "` ,
317+ expect . anything ( )
318+ ) ;
319+ } ) ;
320+
321+ it ( 'runs without a testPathPattern' , async ( ) => {
322+ jest . spyOn ( configHelpers , 'getConfig' ) . mockResolvedValueOnce ( config ) ;
323+ const mockRunIOS = jest . spyOn ( run , 'runIOS' ) . mockResolvedValueOnce ( ) ;
324+
325+ await run . runHandler ( args ) ;
326+
327+ await expect ( mockRunIOS ) . toHaveBeenCalled ( ) ;
328+ await expect ( commandSyncMock ) . toHaveBeenCalledTimes ( 1 ) ;
329+ await expect ( commandSyncMock ) . toHaveBeenCalledWith (
330+ `${ expectedJestCommand } --globals='{\"OWL_CLI_ARGS\":{\"platform\":\"ios\",\"config\":\"./owl.config.json\",\"update\":false}}'` ,
331+ expect . anything ( )
332+ ) ;
333+ } ) ;
305334 } ) ;
306335} ) ;
0 commit comments