You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

playwright-test-coverage-native

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

playwright-test-coverage-native - npm Package Compare versions

Comparing version

to
0.3.0

2

index.js

@@ -20,3 +20,3 @@ const fsPromises = require("node:fs/promises");

const absPath = path.resolve(".");
urlReplacer = (url) => url.replace(/http:\/\/localhost:\d+/, absPath);
urlReplacer = (url) => url.replace(/http:\/\/(.+\.)?localhost:\d+/, absPath);
}

@@ -23,0 +23,0 @@

{
"name": "playwright-test-coverage-native",
"version": "0.2.0",
"version": "0.3.0",
"description": "Extends Playwright for measuring code-coverage (built-in v8 coverage, no Istanbul)",

@@ -26,2 +26,2 @@ "keywords": [

}
}
}

@@ -52,2 +52,18 @@ # playwright-test-coverage-native

## Usage
`playwright-test-coverage-native` is a drop-in replacement for `@playwright/test`. Edit the import of your test files like this:
```diff
-import { test, expect } from '@playwright/test';
+import { test, expect } from 'playwright-test-coverage-native';
```
If you're brave, you can do the changes in bulk:
```shell
# using GNU coreutils
find -type f -name '*.test.?s' -exec sed -i -e 's#@playwright/test#playwright-test-coverage-native#' \;
```
## Post-processing

@@ -64,3 +80,7 @@

> [!NOTE]
> V8 code coverage can be inaccurate due to JavaScript code transformation and source maps,
> in which case alternatives (which use istanbul) may be preferable.
- https://github.com/anishkny/playwright-test-coverage (requires [babel-plugin-istanbul](https://github.com/istanbuljs/babel-plugin-istanbul) instrumentation)
- https://github.com/mxschmitt/playwright-test-coverage (requires [vite-plugin-istanbul](https://github.com/ifaxity/vite-plugin-istanbul))