🌐 AI搜索 & 代理 主页
Skip to content

Commit 5513892

Browse files
committed
fixup! PR feedback
1 parent eab4d55 commit 5513892

File tree

6 files changed

+39
-39
lines changed

6 files changed

+39
-39
lines changed

test/data/testinit.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ this.loadTests = function() {
454454
}
455455

456456
} else {
457-
QUnit.load();
458457

459458
/**
460459
* Run in noConflict mode

test/index.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
// of the test run. We need to read both.
3535
var amd = QUnit.config.amd || QUnit.urlParams.amd;
3636

37-
// Workaround: Remove call to `window.__karma__.loaded()`
38-
// in favour of calling `window.__karma__.start()` from `loadTests()`
39-
// because tests such as unit/ready.js should run after document ready.
4037
if ( !amd ) {
4138
loadTests();
4239
}

test/runner/browserstack/browsers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export async function cleanupAllBrowsers( { verbose } ) {
190190
);
191191
if ( verbose ) {
192192
console.log(
193-
`Stopped ${ numRemaining } browser${ numRemaining > 1 ? "s" : "" }...`
193+
`Stopped ${ numRemaining } browser${ numRemaining > 1 ? "s" : "" }.`
194194
);
195195
}
196196
}

test/runner/browserstack/queue.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 ) {

test/runner/run.js

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,19 @@ const EXIT_HOOK_WAIT_TIMEOUT = 60 * 1000;
2424
/**
2525
* Run modules in parallel in different browser instances.
2626
*/
27-
export async function run( options = {} ) {
28-
let {
29-
amd,
30-
browsers: browserNames,
31-
browserstack,
32-
debug,
33-
headless,
34-
isolate,
35-
modules = [],
36-
retries = 0,
37-
runId,
38-
verbose
39-
} = options;
40-
27+
export async function run( {
28+
amd,
29+
browsers: browserNames,
30+
browserstack,
31+
concurrency,
32+
debug,
33+
headless,
34+
isolate,
35+
modules = [],
36+
retries = 0,
37+
runId,
38+
verbose
39+
} ) {
4140
if ( !browserNames || !browserNames.length ) {
4241
browserNames = [ "chrome" ];
4342
}
@@ -250,21 +249,19 @@ export async function run( options = {} ) {
250249
reportId
251250
} );
252251

252+
const options = {
253+
debug,
254+
modules,
255+
reportId,
256+
runId,
257+
tunnelId,
258+
verbose
259+
};
260+
253261
if ( browserstack ) {
254-
addBrowserStackRun( url, browser, {
255-
...options,
256-
modules,
257-
reportId,
258-
runId,
259-
tunnelId
260-
} );
262+
addBrowserStackRun( url, browser, options );
261263
} else {
262-
addSeleniumRun( url, browser, {
263-
...options,
264-
modules,
265-
reportId,
266-
runId
267-
} );
264+
addSeleniumRun( url, browser, options );
268265
}
269266
}
270267

@@ -281,9 +278,9 @@ export async function run( options = {} ) {
281278
try {
282279
console.log( `Starting Run ${ runId }...` );
283280
if ( browserstack ) {
284-
await runAllBrowserStack( { options, ...runId } );
281+
await runAllBrowserStack( { verbose } );
285282
} else {
286-
await runAllSelenium( options );
283+
await runAllSelenium( { concurrency, verbose } );
287284
}
288285
} catch ( error ) {
289286
console.error( error );

test/runner/selenium/queue.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ export function addSeleniumRun( url, browser, options ) {
2121
queue.push( { url, browser, options } );
2222
}
2323

24-
// TODO: Possibly move this to selenium-only
25-
// and have a queue per browser
2624
export async function runAllSelenium( { concurrency = MAX_CONCURRENCY, verbose } ) {
2725
while ( queue.length ) {
2826
const next = queue.shift();

0 commit comments

Comments
 (0)