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.20 to 0.4.21

8

CHANGELOG.md
# @web/test-runner-playwright
## 0.4.21
### Patch Changes
- d77093b: allow code coverage instrumentation through JS
- Updated dependencies [d77093b]
- @web/test-runner-core@0.6.23
## 0.4.20

@@ -4,0 +12,0 @@

21

dist/PlaywrightLauncherPage.js

@@ -38,3 +38,7 @@ "use strict";

async runSession(url, coverage) {
if (coverage && !this.coverageEnabled && this.playwrightPage.coverage) {
var _a;
if (coverage &&
!this.coverageEnabled &&
this.playwrightPage.coverage &&
((_a = this.config.coverageConfig) === null || _a === void 0 ? void 0 : _a.nativeInstrumentation) !== false) {
this.coverageEnabled = true;

@@ -58,4 +62,15 @@ await this.playwrightPage.coverage.startJSCoverage();

async collectTestCoverage(config, testFiles) {
var _a, _b;
const coverage = ((_b = (await ((_a = this.playwrightPage.coverage) === null || _a === void 0 ? void 0 : _a.stopJSCoverage()))) !== null && _b !== void 0 ? _b : []);
var _a, _b, _c;
if (((_a = config.coverageConfig) === null || _a === void 0 ? void 0 : _a.nativeInstrumentation) !== false) {
// get coverage from the browser, generated by JS
const coverageFromBrowser = await this.playwrightPage.evaluate(() => window.__coverage__);
if (!coverageFromBrowser) {
throw new Error('Coverage is enabled with nativeInstrumentation disabled. ' +
'Expected coverage provided in the browser as a global __coverage__ variable.' +
'Use a plugin like babel-plugin-istanbul to generate the coverage, or enable native instrumentation.');
}
return coverageFromBrowser;
}
// get native coverage from playwright
const coverage = ((_c = (await ((_b = this.playwrightPage.coverage) === null || _b === void 0 ? void 0 : _b.stopJSCoverage()))) !== null && _c !== void 0 ? _c : []);
this.coverageEnabled = false;

@@ -62,0 +77,0 @@ return test_runner_coverage_v8_1.v8ToIstanbul(config, testFiles, coverage);

4

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

@@ -38,3 +38,3 @@ "access": "public"

"@web/browser-logs": "^0.0.1",
"@web/test-runner-core": "^0.6.22",
"@web/test-runner-core": "^0.6.23",
"@web/test-runner-coverage-v8": "^0.0.4",

@@ -41,0 +41,0 @@ "playwright": "^1.3.0"

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