@@ -30,10 +30,14 @@ describe('createRunnerFunction', () => {
3030 ] ;
3131 mockRunAxeForUrl . mockResolvedValue ( mockResults ) ;
3232
33- const runnerFn = createRunnerFunction ( [ 'https://example.com' ] , [ ] ) ;
33+ const runnerFn = createRunnerFunction ( [ 'https://example.com' ] , [ ] , 30_000 ) ;
3434 const results = await runnerFn ( { persist : DEFAULT_PERSIST_CONFIG } ) ;
3535
36- expect ( mockRunAxeForUrl ) . toHaveBeenCalledWith ( 'https://example.com' , [ ] ) ;
36+ expect ( mockRunAxeForUrl ) . toHaveBeenCalledWith (
37+ 'https://example.com' ,
38+ [ ] ,
39+ 30_000 ,
40+ ) ;
3741 expect ( mockCloseBrowser ) . toHaveBeenCalled ( ) ;
3842 expect ( results ) . toEqual ( mockResults ) ;
3943 } ) ;
@@ -55,6 +59,7 @@ describe('createRunnerFunction', () => {
5559 const runnerFn = createRunnerFunction (
5660 [ 'https://example.com' , 'https://another-example.org' ] ,
5761 [ ] ,
62+ 30_000 ,
5863 ) ;
5964 const results = await runnerFn ( { persist : DEFAULT_PERSIST_CONFIG } ) ;
6065
@@ -63,11 +68,13 @@ describe('createRunnerFunction', () => {
6368 1 ,
6469 'https://example.com' ,
6570 [ ] ,
71+ 30_000 ,
6672 ) ;
6773 expect ( mockRunAxeForUrl ) . toHaveBeenNthCalledWith (
6874 2 ,
6975 'https://another-example.org' ,
7076 [ ] ,
77+ 30_000 ,
7178 ) ;
7279 expect ( mockCloseBrowser ) . toHaveBeenCalled ( ) ;
7380
@@ -88,12 +95,17 @@ describe('createRunnerFunction', () => {
8895 mockRunAxeForUrl . mockResolvedValue ( mockResults ) ;
8996
9097 const ruleIds = [ 'image-alt' , 'html-has-lang' ] ;
91- const runnerFn = createRunnerFunction ( [ 'https://example.com' ] , ruleIds ) ;
98+ const runnerFn = createRunnerFunction (
99+ [ 'https://example.com' ] ,
100+ ruleIds ,
101+ 30_000 ,
102+ ) ;
92103 const results = await runnerFn ( { persist : DEFAULT_PERSIST_CONFIG } ) ;
93104
94105 expect ( mockRunAxeForUrl ) . toHaveBeenCalledWith (
95106 'https://example.com' ,
96107 ruleIds ,
108+ 30_000 ,
97109 ) ;
98110 expect ( results ) . toEqual ( mockResults ) ;
99111 } ) ;
@@ -108,6 +120,7 @@ describe('createRunnerFunction', () => {
108120 const runnerFn = createRunnerFunction (
109121 [ 'https://broken.com' , 'https://working.com' ] ,
110122 [ ] ,
123+ 30_000 ,
111124 ) ;
112125 const results = await runnerFn ( { persist : DEFAULT_PERSIST_CONFIG } ) ;
113126
@@ -123,6 +136,7 @@ describe('createRunnerFunction', () => {
123136 const runnerFn = createRunnerFunction (
124137 [ 'https://example.com' , 'https://another-example.com' ] ,
125138 [ ] ,
139+ 30_000 ,
126140 ) ;
127141
128142 await expect ( runnerFn ( { persist : DEFAULT_PERSIST_CONFIG } ) ) . rejects . toThrow (
@@ -133,7 +147,7 @@ describe('createRunnerFunction', () => {
133147 it ( 'should throw error when single URL fails' , async ( ) => {
134148 mockRunAxeForUrl . mockRejectedValue ( new Error ( 'Failed to load page' ) ) ;
135149
136- const runnerFn = createRunnerFunction ( [ 'https://example.com' ] , [ ] ) ;
150+ const runnerFn = createRunnerFunction ( [ 'https://example.com' ] , [ ] , 30_000 ) ;
137151
138152 await expect ( runnerFn ( { persist : DEFAULT_PERSIST_CONFIG } ) ) . rejects . toThrow (
139153 'Axe did not produce any results.' ,
0 commit comments