@web/test-runner-core
Advanced tools
Comparing version 0.6.6 to 0.6.7
# @web/test-runner-core | ||
## 0.6.7 | ||
### Patch Changes | ||
- c72ea22: allow configuring browser launch options | ||
## 0.6.6 | ||
@@ -4,0 +10,0 @@ |
@@ -14,3 +14,3 @@ import { CoverageMapData } from 'istanbul-lib-coverage'; | ||
*/ | ||
start(config: TestRunnerCoreConfig, testFiles: string[]): Promise<string[]>; | ||
start(config: TestRunnerCoreConfig, testFiles: string[]): Promise<string>; | ||
/** | ||
@@ -17,0 +17,0 @@ * One time teardown for the browser launcher. Called when the test runner |
import { TestSession } from '../test-session/TestSession'; | ||
import { BrowserLauncher } from '../browser-launcher/BrowserLauncher'; | ||
export declare function createTestSessions(browserNamesPerLauncher: Map<BrowserLauncher, string[]>, testFiles: string[]): TestSession[]; | ||
export declare function createTestSessions(browserNameForLauncher: Map<BrowserLauncher, string>, testFiles: string[]): TestSession[]; | ||
//# sourceMappingURL=createTestSessions.d.ts.map |
@@ -6,21 +6,19 @@ "use strict"; | ||
const TestSessionStatus_1 = require("../test-session/TestSessionStatus"); | ||
function createTestSessions(browserNamesPerLauncher, testFiles) { | ||
function createTestSessions(browserNameForLauncher, testFiles) { | ||
const sessions = []; | ||
for (const testFile of testFiles) { | ||
for (const [browserLauncher, browserNames] of browserNamesPerLauncher) { | ||
for (const browserName of browserNames) { | ||
const session = { | ||
id: uuid_1.v4(), | ||
testRun: -1, | ||
browserName, | ||
browserLauncher, | ||
status: TestSessionStatus_1.SESSION_STATUS.SCHEDULED, | ||
testFile, | ||
errors: [], | ||
tests: [], | ||
logs: [], | ||
request404s: [], | ||
}; | ||
sessions.push(session); | ||
} | ||
for (const [browserLauncher, browserName] of browserNameForLauncher) { | ||
const session = { | ||
id: uuid_1.v4(), | ||
testRun: -1, | ||
browserName, | ||
browserLauncher, | ||
status: TestSessionStatus_1.SESSION_STATUS.SCHEDULED, | ||
testFile, | ||
errors: [], | ||
tests: [], | ||
logs: [], | ||
request404s: [], | ||
}; | ||
sessions.push(session); | ||
} | ||
@@ -27,0 +25,0 @@ } |
@@ -42,16 +42,8 @@ "use strict"; | ||
this.startTime = Date.now(); | ||
const browserNamesPerLauncher = new Map(); | ||
const browserNameForLauncher = new Map(); | ||
this.browserNames = []; | ||
for (const launcher of this.browserLaunchers) { | ||
const names = await launcher.start(this.config, this.testFiles); | ||
if (!Array.isArray(names) || names.length === 0 || names.some(n => typeof n !== 'string')) { | ||
throw new Error('Browser start must return an array of strings.'); | ||
} | ||
for (const name of names) { | ||
if (this.browserNames.includes(name)) { | ||
throw new Error(`Multiple browser launchers return the same browser name ${name}`); | ||
} | ||
this.browserNames.push(name); | ||
} | ||
browserNamesPerLauncher.set(launcher, names); | ||
const name = await launcher.start(this.config, this.testFiles); | ||
this.browserNames.push(name); | ||
browserNameForLauncher.set(launcher, name); | ||
} | ||
@@ -62,3 +54,3 @@ this.favoriteBrowser = (_a = this.browserNames.find(browserName => { | ||
})) !== null && _a !== void 0 ? _a : this.browserNames[0]; | ||
const createdSessions = createTestSessions_1.createTestSessions(browserNamesPerLauncher, this.testFiles); | ||
const createdSessions = createTestSessions_1.createTestSessions(browserNameForLauncher, this.testFiles); | ||
for (const session of createdSessions) { | ||
@@ -65,0 +57,0 @@ this.sessions.add(session); |
{ | ||
"name": "@web/test-runner-core", | ||
"version": "0.6.6", | ||
"version": "0.6.7", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
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
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
70131
851