@web/test-runner-core
Advanced tools
Comparing version 0.8.1 to 0.8.2
# @web/test-runner-core | ||
## 0.8.2 | ||
### Patch Changes | ||
- 859008b: added experimental mode to test workflows where tests on firefox require the browser window to be focused | ||
## 0.8.1 | ||
@@ -4,0 +10,0 @@ |
@@ -18,2 +18,3 @@ import { CoverageMapData } from 'istanbul-lib-coverage'; | ||
type: string; | ||
__experimentalWindowFocus__?: boolean; | ||
/** | ||
@@ -20,0 +21,0 @@ * One time startup for the browser launcher. Called when the test runner |
@@ -14,3 +14,3 @@ "use strict"; | ||
this.sessions = sessions; | ||
this.browsers = browsers; | ||
this.browsers = [...browsers].sort((a, b) => (a.__experimentalWindowFocus__ ? 1 : 0) - (b.__experimentalWindowFocus__ ? 1 : 0)); | ||
this.timeoutHandler = new TestSessionTimeoutHandler_1.TestSessionTimeoutHandler(this.config, this.sessions, this); | ||
@@ -58,2 +58,5 @@ this.browserStartTimeoutMsg = | ||
for (const browser of this.browsers) { | ||
if (runningBrowsers >= 1 && browser.__experimentalWindowFocus__) { | ||
return; | ||
} | ||
if (runningBrowsers >= this.config.concurrentBrowsers) { | ||
@@ -68,3 +71,4 @@ // do not boot up more than the allowed concurrent browsers | ||
const runningCount = this.getRunningSessions(browser).length; | ||
const runBudget = Math.max(0, this.config.concurrency - runningCount); | ||
const maxBudget = browser.__experimentalWindowFocus__ ? 1 : this.config.concurrency; | ||
const runBudget = Math.max(0, maxBudget - runningCount); | ||
if (runBudget !== 0) { | ||
@@ -71,0 +75,0 @@ // we have budget to schedule new sessions for this browser |
{ | ||
"name": "@web/test-runner-core", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
@@ -21,2 +21,4 @@ import { CoverageMapData } from 'istanbul-lib-coverage'; | ||
__experimentalWindowFocus__?: boolean; | ||
/** | ||
@@ -23,0 +25,0 @@ * One time startup for the browser launcher. Called when the test runner |
@@ -26,3 +26,5 @@ import { createSessionUrl } from './createSessionUrl'; | ||
this.sessions = sessions; | ||
this.browsers = browsers; | ||
this.browsers = [...browsers].sort( | ||
(a, b) => (a.__experimentalWindowFocus__ ? 1 : 0) - (b.__experimentalWindowFocus__ ? 1 : 0), | ||
); | ||
this.timeoutHandler = new TestSessionTimeoutHandler(this.config, this.sessions, this); | ||
@@ -81,2 +83,6 @@ this.browserStartTimeoutMsg = | ||
for (const browser of this.browsers) { | ||
if (runningBrowsers >= 1 && browser.__experimentalWindowFocus__) { | ||
return; | ||
} | ||
if (runningBrowsers >= this.config.concurrentBrowsers) { | ||
@@ -93,3 +99,4 @@ // do not boot up more than the allowed concurrent browsers | ||
const runningCount = this.getRunningSessions(browser).length; | ||
const runBudget = Math.max(0, this.config.concurrency - runningCount); | ||
const maxBudget = browser.__experimentalWindowFocus__ ? 1 : this.config.concurrency; | ||
const runBudget = Math.max(0, maxBudget - runningCount); | ||
if (runBudget !== 0) { | ||
@@ -96,0 +103,0 @@ // we have budget to schedule new sessions for this browser |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
257420
4359