@piwitests/reporter 0.64.0 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,7 @@ declare const ATTACHMENT_NAMES: {
19
19
  readonly codeReach: "piwi-code-reach";
20
20
  readonly browserCoverage: "piwi-browser-coverage";
21
21
  readonly browserFunctions: "piwi-browser-functions";
22
+ readonly browserLines: "piwi-browser-lines";
22
23
  readonly cssCoverage: "piwi-css-coverage";
23
24
  readonly cssRules: "piwi-css-rules";
24
25
  readonly serverCoverageRequests: "piwi-server-coverage-requests";
@@ -49,7 +50,7 @@ declare function isPiwiAttachment(attachment: {
49
50
  /**
50
51
  * The last of `attachments` that `isPiwiAttachment` accepts for `name`. A
51
52
  * reader of an attachment the fixtures write more than once
52
- * (`piwi-browser-functions`, `piwi-css-rules`) goes through every match with
53
+ * (`piwi-browser-functions`, `piwi-browser-lines`, `piwi-css-rules`) goes through every match with
53
54
  * `isPiwiAttachment` instead.
54
55
  */
55
56
  declare function findPiwiAttachment<T extends {
@@ -47,6 +47,7 @@ var ATTACHMENT_NAMES = {
47
47
  codeReach: "piwi-code-reach",
48
48
  browserCoverage: "piwi-browser-coverage",
49
49
  browserFunctions: "piwi-browser-functions",
50
+ browserLines: "piwi-browser-lines",
50
51
  cssCoverage: "piwi-css-coverage",
51
52
  cssRules: "piwi-css-rules",
52
53
  serverCoverageRequests: "piwi-server-coverage-requests",
@@ -172,6 +172,14 @@ declare function internalCall<T>(owner: unknown, run: () => Promise<T>): Promise
172
172
  * mapping of its own and would otherwise take that of whatever precedes it;
173
173
  * it runs when a module is imported, so it counts for no file.
174
174
  *
175
+ * At line granularity, V8's block coverage tells which code ran inside a
176
+ * function: at each offset, the innermost range around it (a function or a
177
+ * block) gives its count. A source line is executable when a source map
178
+ * segment maps to it, and it ran when one of those segments starts at an
179
+ * offset that ran. A script with no map counts the lines holding code inside
180
+ * the functions V8 lists, its top level left out, and one of them ran when
181
+ * code on it ran.
182
+ *
175
183
  * The reporter feeds this with V8's function coverage, read over a CDP
176
184
  * session; this module holds the pure part.
177
185
  */
@@ -190,6 +198,8 @@ interface JsCoverageEntry {
190
198
  }>;
191
199
  }>;
192
200
  }
201
+ /** Offsets of a script, half-open (`[start, end)`), sorted, disjoint and never adjacent. */
202
+ type OffsetRange = [start: number, end: number];
193
203
 
194
204
  /** Where code reach resolves paths. */
195
205
  interface CodeReachRoots {
@@ -218,6 +228,8 @@ interface CoveredScript extends JsCoverageEntry {
218
228
  hash?: string;
219
229
  /** The address of the page's document as it parsed the script, whose origin's roots it falls back on. */
220
230
  pageUrl?: string;
231
+ /** With block coverage, the offsets of the script that ran in any read. */
232
+ executed?: OffsetRange[];
221
233
  }
222
234
  /**
223
235
  * The roots for a test: `codeReachRoots` when set (an array, or the `*` entry of