Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@web/test-runner-playwright

Package Overview
Dependencies
Maintainers
6
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web/test-runner-playwright - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

9

CHANGELOG.md
# @web/test-runner-playwright
## 0.4.1
### Patch Changes
- 3dab600: profile test coverage through v8/chromium
- Updated dependencies [3dab600]
- @web/test-runner-core@0.6.2
- @web/test-runner-coverage-v8@0.0.1
## 0.4.0

@@ -4,0 +13,0 @@

26

dist/playwrightLauncher.js

@@ -8,2 +8,3 @@ "use strict";

const playwright_1 = __importDefault(require("playwright"));
const test_runner_coverage_v8_1 = require("@web/test-runner-coverage-v8");
const validBrowserTypes = ['chromium', 'firefox', 'webkit'];

@@ -15,2 +16,4 @@ function playwrightLauncher({ browserTypes = ['chromium'], } = {}) {

const inactivePages = [];
let config;
let testFiles;
if (browserTypes.some(t => !validBrowserTypes.includes(t))) {

@@ -20,3 +23,5 @@ throw new Error(`Invalid browser types: ${browserTypes}. Valid browser types: ${validBrowserTypes.join(', ')}`);

return {
async start() {
async start(_config, _testFiles) {
config = _config;
testFiles = _testFiles;
const browserNames = [];

@@ -44,2 +49,3 @@ for (const type of browserTypes) {

async startSession(session, url) {
var _a;
const browser = browsers.get(session.browserName);

@@ -60,2 +66,5 @@ if (!browser) {

activePages.set(session.id, page);
if (config.coverage) {
await ((_a = page.coverage) === null || _a === void 0 ? void 0 : _a.startJSCoverage());
}
await page.goto(url);

@@ -70,2 +79,17 @@ },

},
async getTestCoverage(session) {
var _a, _b;
const page = activePages.get(session.id);
if (!page) {
throw new Error(`No page for session ${session.id}`);
}
let istanbulCoverage = undefined;
if (config.coverage) {
const coverage = ((_b = (await ((_a = page.coverage) === null || _a === void 0 ? void 0 : _a.stopJSCoverage()))) !== null && _b !== void 0 ? _b : []);
istanbulCoverage = await test_runner_coverage_v8_1.v8ToIstanbul(config, testFiles, coverage);
}
activePages.delete(session.id);
inactivePages.push(page);
return istanbulCoverage;
},
async startDebugSession(session, url) {

@@ -72,0 +96,0 @@ const browserType = session.browserName.toLowerCase();

9

package.json
{
"name": "@web/test-runner-playwright",
"version": "0.4.0",
"version": "0.4.1",
"publishConfig": {

@@ -39,9 +39,10 @@ "access": "public"

"dependencies": {
"@web/test-runner-core": "^0.6.0",
"playwright": "1.0.2"
"@web/test-runner-core": "^0.6.2",
"@web/test-runner-coverage-v8": "^0.0.1",
"playwright": "^1.2.0"
},
"devDependencies": {
"@web/test-runner-mocha": "^0.2.5",
"@web/test-runner-server": "^0.5.0"
"@web/test-runner-server": "^0.5.6"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc