@@ -11,12 +11,21 @@ export function getNextBrowserTest( reportId ) {
1111 if ( index === - 1 ) {
1212 return ;
1313 }
14+
15+ // Remove the completed test from the queue
1416 const previousTest = queue [ index ] ;
1517 queue . splice ( index , 1 ) ;
18+
19+ // Find the next test for the same browser
1620 for ( const test of queue . slice ( index ) ) {
1721 if ( test . fullBrowser === previousTest . fullBrowser ) {
22+
23+ // Set the URL for our tracking
1824 setBrowserWorkerUrl ( test . browser , test . url ) ;
1925 test . running = true ;
26+
27+ // Return the URL for the next test.
28+ // listeners.js will use this to set the browser URL.
2029 return { url : test . url } ;
2130 }
2231 }
@@ -49,16 +58,16 @@ export function addBrowserStackRun( url, browser, options ) {
4958 } ) ;
5059}
5160
52- export async function runAllBrowserStack ( options ) {
61+ export async function runAllBrowserStack ( ) {
5362 return new Promise ( async ( resolve , reject ) => {
5463 while ( queue . length ) {
5564 try {
56- await checkLastTouches ( options ) ;
65+ await checkLastTouches ( ) ;
5766 } catch ( error ) {
5867 reject ( error ) ;
5968 }
6069
61- // Run one test per browser at a time
70+ // Run one test URL per browser at a time
6271 const browsersTaken = [ ] ;
6372 for ( const test of queue ) {
6473 if ( browsersTaken . indexOf ( test . fullBrowser ) > - 1 ) {
0 commit comments