Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(JSCoverageEntry): added scriptId and isBlockCoverage (#2955)

Tapajyoti Bose16e3776a9cc0
diff --git a/docs/api.md b/docs/api.md
index 81b942d698..db37b1135c 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -4299,9 +4299,11 @@ const v8toIstanbul = require('v8-to-istanbul');
#### chromiumCoverage.stopJSCoverage()
- returns: <[Promise]<[Array]<[Object]>>> Promise that resolves to the array of coverage reports for all scripts
- `url` <[string]> Script URL
+ - `scriptId` <[string]> Script ID
- `source` <[string]> Script content, if applicable.
- `functions` <[Array]<[Object]>> V8-specific coverage format.
- `functionName` <[string]>
+ - `isBlockCoverage` <[boolean]>
- `ranges` <[Array]<[Object]>>
- `count` <[number]>
- `startOffset` <[number]>
diff --git a/src/types.ts b/src/types.ts
index 0a6aae824f..e53dcfe121 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -149,9 +149,11 @@ export type CSSCoverageEntry = {
export type JSCoverageEntry = {
url: string,
+ scriptId: string,
source?: string,
functions: {
functionName: string,
+ isBlockCoverage: boolean,
ranges: JSRange[]
}[]
};