monocart-coverage-reports 2.2.0 → 2.2.1

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.
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  * [Usage](#usage)
12
12
  * [Default Options](#default-options)
13
13
  * [Available Reports](#available-reports)
14
- * [Multiprocessing Support](#multiprocessing-support)
14
+ * [Using `entryFilter` and `sourceFilter` to filter the results for V8 report](#using-entryfilter-and-sourcefilter-to-filter-the-results-for-v8-report)
15
15
  * [onEnd Hook](#onend-hook)
16
16
  * [`mcr` CLI](#mcr-cli)
17
17
  * [Compare Reports](#compare-reports)
@@ -19,13 +19,14 @@
19
19
  * [Collecting Istanbul Coverage Data](#collecting-istanbul-coverage-data)
20
20
  * [Collecting V8 Coverage Data](#collecting-v8-coverage-data)
21
21
  * [Node.js V8 Coverage Report for Server Side](#nodejs-v8-coverage-report-for-server-side)
22
- * [Using `entryFilter` and `sourceFilter` to filter the results for V8 report](#using-entryfilter-and-sourcefilter-to-filter-the-results-for-v8-report)
22
+ * [Multiprocessing Support](#multiprocessing-support)
23
+ * [Integration](#integration)
24
+ * [Ignoring Uncovered Codes](#ignoring-uncovered-codes)
25
+ * [Chromium Coverage API](#chromium-coverage-api)
26
+ * [V8 Coverage Data Format](#v8-coverage-data-format)
23
27
  * [How to convert V8 to Istanbul](#how-to-convert-v8-to-istanbul)
24
28
  - [Using `v8-to-istanbul`](#using-v8-to-istanbul)
25
29
  - [How Monocart Works](#how-monocart-works)
26
- * [Ignoring Uncovered Lines](#ignoring-uncovered-lines)
27
- * [Chromium Coverage API](#chromium-coverage-api)
28
- * [V8 Coverage Data Format](#v8-coverage-data-format)
29
30
  * [Istanbul Introduction](#istanbul-introduction)
30
31
  * [Thanks](#thanks)
31
32
 
@@ -54,6 +55,7 @@ console.log(coverageResults.summary);
54
55
  - Build with webpack: [V8](https://cenfun.github.io/monocart-coverage-reports/v8) and [V8 Minify](https://cenfun.github.io/monocart-coverage-reports/v8-minify)
55
56
  - Build with [Rollup](https://cenfun.github.io/monocart-coverage-reports/v8-rollup) and [Esbuild](https://cenfun.github.io/monocart-coverage-reports/v8-esbuild)
56
57
  - Collect with [puppeteer](https://cenfun.github.io/monocart-coverage-reports/puppeteer/)
58
+ - [anonymous](https://cenfun.github.io/monocart-coverage-reports/anonymous/) and [css](https://cenfun.github.io/monocart-coverage-reports/css/)
57
59
  - Test in Node.js
58
60
  - Collect with [env](https://cenfun.github.io/monocart-coverage-reports/v8-node-env), and also V8 [API](https://cenfun.github.io/monocart-coverage-reports/v8-node-api), [Inspector](https://cenfun.github.io/monocart-coverage-reports/v8-node-ins) and [CDP](https://cenfun.github.io/monocart-coverage-reports/v8-node-cdp)
59
61
  - Web server example: [koa](https://cenfun.github.io/monocart-coverage-reports/v8-node-koa/)
@@ -105,37 +107,34 @@ const options = {
105
107
  const coverageReport = MCR(options);
106
108
  ```
107
109
 
108
- ## Integration
109
- - [monocart-reporter](https://cenfun.github.io/monocart-reporter/) - Test reporter for [Playwright](https://github.com/microsoft/playwright)
110
- - [vitest-monocart-coverage](https://github.com/cenfun/vitest-monocart-coverage) - Integration with [Vitest](https://github.com/vitest-dev/vitest) coverage
111
-
112
-
113
- ## Multiprocessing Support
114
- The data will be added to `[outputDir]/.cache`, and the cache will be removed after reports generated.
115
- - sub process 1
116
- ```js
117
- const MCR = require('monocart-coverage-reports');
118
- const options = require('path-to/same-options.js');
119
- const coverageReport = MCR(options);
120
- await coverageReport.add(coverageData1);
110
+ ## Using `entryFilter` and `sourceFilter` to filter the results for V8 report
111
+ When V8 coverage data collected, it actually contains the data of all entry files, for example:
121
112
  ```
122
-
123
- - sub process 2
124
- ```js
125
- const MCR = require('monocart-coverage-reports');
126
- const options = require('path-to/same-options.js');
127
- const coverageReport = MCR(options);
128
- await coverageReport.add(coverageData2);
113
+ dist/main.js
114
+ dist/vendor.js
115
+ dist/something-else.js
129
116
  ```
130
-
131
- - main process
117
+ We can use `entryFilter` to filter the entry files. For example, we should remove `vendor.js` and `something-else.js` if they are not in our coverage scope.
118
+ ```
119
+ dist/main.js
120
+ ```
121
+ When inline or linked sourcemap exists to the entry file, the source files will be extracted from the sourcemap for the entry file, and the entry file will be removed if `logging` is not `debug`.
122
+ ```
123
+ > src/index.js
124
+ > src/components/app.js
125
+ > node_modules/dependency/dist/dependency.js
126
+ ```
127
+ We can use `sourceFilter` to filter the source files. For example, we should remove `dependency.js` if it is not in our coverage scope.
128
+ ```
129
+ > src/index.js
130
+ > src/components/app.js
131
+ ```
132
+ Example:
132
133
  ```js
133
- // after all sub processes finished
134
- const MCR = require('monocart-coverage-reports');
135
- const options = require('path-to/same-options.js');
136
- const coverageReport = MCR(options);
137
- const coverageResults = await coverageReport.generate();
138
- console.log(coverageResults.summary);
134
+ const coverageOptions = {
135
+ entryFilter: (entry) => entry.url.indexOf("main.js") !== -1,
136
+ sourceFilter: (sourcePath) => sourcePath.search(/src\//) !== -1
137
+ };
139
138
  ```
140
139
 
141
140
  ## onEnd Hook
@@ -170,6 +169,7 @@ const coverageOptions = {
170
169
  ```
171
170
 
172
171
  ## `mcr` CLI
172
+ > The CLI will run the program as a [child process](https://nodejs.org/docs/latest/api/child_process.html) with `NODE_V8_COVERAGE=dir` until it exits gracefully, and generate the coverage report with the coverage data from the `dir`.
173
173
  - Global mode
174
174
  ```sh
175
175
  npm i monocart-coverage-reports -g
@@ -201,7 +201,7 @@ Options:
201
201
  --lcov generate lcov.info file
202
202
  -h, --help display help for command
203
203
  ```
204
- - Using configuration file for more options
204
+ - Using configuration file for more [options](#default-options)
205
205
  ```sh
206
206
  mcr "node ./test/test-node-env.js" -c test/cli-options.js
207
207
  ```
@@ -234,139 +234,103 @@ mcr "node ./test/test-node-env.js" -c test/cli-options.js
234
234
  ## Collecting Istanbul Coverage Data
235
235
  - Instrumenting source code
236
236
  > Before collecting Istanbul coverage data, It requires your source code is instrumented with Istanbul
237
- - Webpack: [babel-plugin-istanbul](https://github.com/istanbuljs/babel-plugin-istanbul), example: [webpack.config-istanbul.js](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/webpack.config-istanbul.js)
238
- - Rollup: [rollup-plugin-istanbul](https://github.com/artberri/rollup-plugin-istanbul)
239
- - Vite: [vite-plugin-istanbul](https://github.com/ifaxity/vite-plugin-istanbul)
237
+ - webpack: [babel-plugin-istanbul](https://github.com/istanbuljs/babel-plugin-istanbul), example: [webpack.config-istanbul.js](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/webpack.config-istanbul.js)
238
+ - rollup: [rollup-plugin-istanbul](https://github.com/artberri/rollup-plugin-istanbul)
239
+ - vite: [vite-plugin-istanbul](https://github.com/ifaxity/vite-plugin-istanbul)
240
240
  - Browser
241
- > Collecting coverage data from `window.__coverage__`, example: [test-istanbul.js](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-istanbul.js)
241
+ - Collecting coverage data from `window.__coverage__`, example: [test-istanbul.js](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-istanbul.js)
242
242
  - Node.js
243
- > Collecting coverage data from `global.__coverage__`
243
+ - Collecting coverage data from `global.__coverage__`
244
244
 
245
245
  ## Collecting V8 Coverage Data
246
246
  - For source code: enable `sourcemap` and do not compress/minify:
247
- - Webpack: build with `source-map` [devtool](https://webpack.js.org/configuration/devtool/) and `development` [mode](https://webpack.js.org/configuration/mode/), example [webpack.config-v8.js](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/webpack.config-v8.js)
248
- - Rollup: build with [options](https://rollupjs.org/configuration-options/) `sourcemap: true`
249
- - Vite: build with [options](https://vitejs.dev/config/build-options.html) `sourcemap: true` and `minify: false`
247
+ - [webpack](https://webpack.js.org/configuration/): `devtool: source-map` and `mode: development`, example [webpack.config-v8.js](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/webpack.config-v8.js)
248
+ - [rollup](https://rollupjs.org/configuration-options/): `sourcemap: true`
249
+ - [vite](https://vitejs.dev/config/build-options.html): `sourcemap: true` and `minify: false`
250
+ - [esbuild](https://esbuild.github.io/api/): `sourcemap: true` and `minify: false`
250
251
  - Browser (Chromium Only)
251
- > Collecting coverage data with [Chromium Coverage API](#chromium-coverage-api), see [playwright example](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-v8.js) or [puppeteer example](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-puppeteer.js)
252
+ > Collecting coverage data with [Chromium Coverage API](#chromium-coverage-api):
253
+ - [Playwright example](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-v8.js), and [anonymous](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-anonymous.js), [css](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-css.js)
254
+ - [Puppeteer example](https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-puppeteer.js)
252
255
  - Node.js
253
- > see [Node.js V8 Coverage Report for Server Side](#nodejs-v8-coverage-report-for-server-side)
256
+ - see following [Node.js V8 Coverage Report for Server Side](#nodejs-v8-coverage-report-for-server-side)
254
257
 
255
258
 
256
259
  ## Node.js V8 Coverage Report for Server Side
257
260
  Possible solutions:
258
- - Node.js env [NODE_V8_COVERAGE](https://nodejs.org/docs/latest/api/cli.html#node_v8_coveragedir)=`dir`
259
- - Before running your Node.js application, set env `NODE_V8_COVERAGE`=`dir`. After the application runs and exits, the coverage data will be saved to the `dir` directory in JSON file format
260
- - Read the json file(s) from the `dir` and generate coverage report
261
- - example:
261
+ - [NODE_V8_COVERAGE](https://nodejs.org/docs/latest/api/cli.html#node_v8_coveragedir)=`dir`
262
+ - Sets Node.js env `NODE_V8_COVERAGE`=`dir` before the program running, the coverage data will be saved to the `dir` after the program exits gracefully.
263
+ - Read the JSON file(s) from the `dir` and generate coverage report.
264
+ - Example:
262
265
  > cross-env NODE_V8_COVERAGE=`.temp/v8-coverage-env` node [./test/test-node-env.js](./test/test-node-env.js) && node [./test/generate-node-report.js](./test/generate-node-report.js)
263
266
 
264
267
  - [V8](https://nodejs.org/docs/latest/api/v8.html#v8takecoverage) API + NODE_V8_COVERAGE
265
- - Writing the coverage started by NODE_V8_COVERAGE to disk on demand with `v8.takeCoverage()` and stopping with `v8.stopCoverage()`.
266
- - example:
268
+ - Writing the coverage started by NODE_V8_COVERAGE to disk on demand with `v8.takeCoverage()`, it does not require waiting until the program exits gracefully.
269
+ - Example:
267
270
  > cross-env NODE_V8_COVERAGE=`.temp/v8-coverage-api` node [./test/test-node-api.js](./test/test-node-api.js)
268
271
 
269
- - [Inspector](https://nodejs.org/docs/latest/api/inspector.html) API (or module [collect-v8-coverage](https://github.com/SimenB/collect-v8-coverage))
272
+ - [Inspector](https://nodejs.org/docs/latest/api/inspector.html) API
270
273
  - Connecting to the V8 inspector and enable V8 coverage.
271
- - Taking coverage data and adding to the report after your application runs.
272
- - example: [./test/test-node-ins.js](./test/test-node-ins.js)
274
+ - Taking coverage data and adding it to the report.
275
+ - Example:
276
+ > node [./test/test-node-ins.js](./test/test-node-ins.js)
273
277
 
274
278
  - [CDP](https://chromedevtools.github.io/devtools-protocol/) API
275
- - Enabling [Node Debugging](https://nodejs.org/en/guides/debugging-getting-started/)
279
+ - Enabling [Node Debugging](https://nodejs.org/en/guides/debugging-getting-started/).
276
280
  - Collecting coverage data with CDP API.
277
- - example: [./test/test-node-cdp.js](./test/test-node-cdp.js)
281
+ - Example:
282
+ > node --inspect=9229 [./test/test-node-cdp.js](./test/test-node-cdp.js)
278
283
 
279
- - [Debugger](https://nodejs.org/en/guides/debugging-getting-started) + NODE_V8_COVERAGE + CDP + V8 API
280
- > cross-env NODE_V8_COVERAGE=.temp/v8-coverage-koa node --inspect=9229 [./test/koa.js](./test/koa.js)
281
- - example:
284
+ - [Node Debugging](https://nodejs.org/en/guides/debugging-getting-started) + CDP + NODE_V8_COVERAGE + V8 API
285
+ - When the program starts a server, it will not exit on its own, thus requiring a manual invocation of the `v8.takeCoverage()` interface to manually collect coverage data. Remote invocation of the `v8.takeCoverage()` interface can be accomplished through the `Runtime.evaluate` of the CDP.
286
+ - Example for [koa](https://github.com/koajs/koa) web server:
282
287
  > node [./test/test-node-koa.js](./test/test-node-koa.js)
283
288
 
284
- ## Using `entryFilter` and `sourceFilter` to filter the results for V8 report
285
- When V8 coverage data collected, it actually contains the data of all entry files, for example:
286
- ```
287
- dist/main.js
288
- dist/vendor.js
289
- dist/something-else.js
290
- ```
291
- We can use `entryFilter` to filter the entry files. For example, we should remove `vendor.js` and `something-else.js` if they are not in our coverage scope.
292
- ```
293
- dist/main.js
294
- ```
295
- When inline or linked sourcemap exists to the entry file, the source files will be extracted from the sourcemap for the entry file, and the entry file will be removed if `logging` is not `debug`.
296
- ```
297
- > src/index.js
298
- > src/components/app.js
299
- > node_modules/dependency/dist/dependency.js
300
- ```
301
- We can use `sourceFilter` to filter the source files. For example, we should remove `dependency.js` if it is not in our coverage scope.
302
- ```
303
- > src/index.js
304
- > src/components/app.js
305
- ```
306
- Example:
289
+ - [Child Process](https://nodejs.org/docs/latest/api/child_process.html) + NODE_V8_COVERAGE
290
+ - see [`mcr` CLI](#mcr-cli)
291
+
292
+ ## Multiprocessing Support
293
+ The data will be added to `[outputDir]/.cache`, and the cache will be removed after reports generated.
294
+ - sub process 1
307
295
  ```js
308
- const coverageOptions = {
309
- entryFilter: (entry) => entry.url.indexOf("main.js") !== -1,
310
- sourceFilter: (sourcePath) => sourcePath.search(/src\//) !== -1
311
- };
296
+ const MCR = require('monocart-coverage-reports');
297
+ const options = require('path-to/same-options.js');
298
+ const coverageReport = MCR(options);
299
+ await coverageReport.add(coverageData1);
312
300
  ```
313
301
 
314
- ## How to convert V8 to Istanbul
315
- ### Using [v8-to-istanbul](https://github.com/istanbuljs/v8-to-istanbul)
316
- It is a popular library which is used to convert V8 coverage format to istanbul's coverage format. Most test frameworks are using it, such as [Jest](https://github.com/jestjs/jest/), [Vitest](https://github.com/vitest-dev/vitest), but it has two major problems:
317
- - 1, The source mapping does not work well if the position is between the two consecutive mappings. for example:
302
+ - sub process 2
318
303
  ```js
319
- const a = tf ? 'true' : 'false';
320
- ^ ^ ^
321
- m1 p m2
304
+ const MCR = require('monocart-coverage-reports');
305
+ const options = require('path-to/same-options.js');
306
+ const coverageReport = MCR(options);
307
+ await coverageReport.add(coverageData2);
322
308
  ```
323
- > `m1` and `m2` are two consecutive mappings, `p` is the position we looking for. However, we can only get the position of the `m1` if we don't fix it to `p`. Especially the generated code is different from the original code, such as minified, compressed or converted, then it becomes very difficult to find the middle position between two mappings.
324
309
 
325
- - 2, The coverage of functions and branches is incorrect. V8 only provided coverage at functions and it's blocks. But if a function is uncovered (count = 0), there is no information for it's blocks and sub-level functions.
326
- And also there are some problems about counting the functions and branches:
310
+ - main process
327
311
  ```js
328
- functions.forEach(block => {
329
- block.ranges.forEach((range, i) => {
330
- if (block.isBlockCoverage) {
331
- // v8-to-istanbul: new CovBranch()
332
- // Problem: not every block is branch, and the first block is actually function.
333
- if (block.functionName && i === 0) {
334
- // v8-to-istanbul: new CovFunction()
335
- // Problem: no anonymous function
336
- }
337
- } else if (block.functionName) {
338
- // v8-to-istanbul: new CovFunction()
339
- // Problem: no anonymous function
340
- }
341
- }
342
- });
343
- // Problem: When the function or parent-level function is uncovered, then its sub-level functions will never be counted.
312
+ // after all sub processes finished
313
+ const MCR = require('monocart-coverage-reports');
314
+ const options = require('path-to/same-options.js');
315
+ const coverageReport = MCR(options);
316
+ const coverageResults = await coverageReport.generate();
317
+ console.log(coverageResults.summary);
344
318
  ```
345
- see source code [v8-to-istanbul.js](https://github.com/istanbuljs/v8-to-istanbul/blob/master/lib/v8-to-istanbul.js)
346
-
347
- ### How Monocart Works
348
- We have removed `v8-to-istanbul` because of the two major problems and implemented new converter:
349
- - 1, Trying to fix the middle position if not found the exact mapping.
350
- - 2, Finding all functions and branches by parsing the source code [AST](https://github.com/acornjs/acorn), however the V8 cannot provide effective branch coverage information, so the branches is still not perfect.
351
319
 
352
- | AST | V8 |
353
- | :--------------| :------ |
354
- | AssignmentPattern | 🛇 Not Support |
355
- | ConditionalExpression | ✔ Not Perfect |
356
- | IfStatement | ✔ Not Perfect |
357
- | LogicalExpression | ✔ Not Perfect |
358
- | SwitchStatement | ✔ Not Perfect |
320
+ ## Integration
321
+ - [monocart-reporter](https://cenfun.github.io/monocart-reporter/) - Test reporter for [Playwright](https://github.com/microsoft/playwright)
322
+ - [vitest-monocart-coverage](https://github.com/cenfun/vitest-monocart-coverage) - Integration with [Vitest](https://github.com/vitest-dev/vitest) coverage
359
323
 
360
324
  ## Ignoring Uncovered Codes
361
325
  To ignore codes, use the special comment which starts with `v8 ignore `:
362
- - ignoring all until told
326
+ - Ignoring all until stop
363
327
  ```js
364
328
  /* v8 ignore start */
365
329
  function uncovered() {
366
330
  }
367
331
  /* v8 ignore stop */
368
332
  ```
369
- - ignoring the next line or next N lines
333
+ - Ignoring the next line or next N lines
370
334
  ```js
371
335
  /* v8 ignore next */
372
336
  const os = platform === 'wind32' ? 'Windows' : 'Other';
@@ -448,6 +412,52 @@ const rawV8CoverageData = jsCoverage.map((it) => {
448
412
  ```
449
413
  see example: [./test/test-puppeteer.js](./test/test-puppeteer.js)
450
414
 
415
+ ## How to convert V8 to Istanbul
416
+ ### Using [v8-to-istanbul](https://github.com/istanbuljs/v8-to-istanbul)
417
+ It is a popular library which is used to convert V8 coverage format to istanbul's coverage format. Most test frameworks are using it, such as [Jest](https://github.com/jestjs/jest/), [Vitest](https://github.com/vitest-dev/vitest), but it has two major problems:
418
+ - 1, The source mapping does not work well if the position is between the two consecutive mappings. for example:
419
+ ```js
420
+ const a = tf ? 'true' : 'false';
421
+ ^ ^ ^
422
+ m1 p m2
423
+ ```
424
+ > `m1` and `m2` are two consecutive mappings, `p` is the position we looking for. However, we can only get the position of the `m1` or `m2` if we don't fix it to `p`. Especially the generated code is different from the original code, such as the code was minified, compressed or converted, it is difficult to find the exact position.
425
+
426
+ - 2, The coverage of functions and branches is incorrect. V8 only provided coverage at functions and it's blocks. But if a function is uncovered (count = 0), there is no information for it's blocks and sub-level functions.
427
+ And also there are some problems about counting the functions and branches:
428
+ ```js
429
+ // Problem: When the function or parent-level function is uncovered, then its sub-level functions will never be counted.
430
+ functions.forEach(block => {
431
+ block.ranges.forEach((range, i) => {
432
+ if (block.isBlockCoverage) {
433
+ // v8-to-istanbul: new CovBranch()
434
+ // Problem: not every block is branch, and the first block could be function.
435
+ if (block.functionName && i === 0) {
436
+ // v8-to-istanbul: new CovFunction()
437
+ // Problem: no anonymous function
438
+ }
439
+ } else if (block.functionName) {
440
+ // v8-to-istanbul: new CovFunction()
441
+ // Problem: no anonymous function
442
+ }
443
+ }
444
+ });
445
+ ```
446
+ see source code [v8-to-istanbul.js](https://github.com/istanbuljs/v8-to-istanbul/blob/master/lib/v8-to-istanbul.js)
447
+
448
+ ### How Monocart Works
449
+ We implemented new converter instead of v8-to-istanbul:
450
+ - 1, Trying to fix the middle position if not found the exact mapping for the position.
451
+ - 2, Finding all functions and branches by parsing the source code [AST](https://github.com/acornjs/acorn), however the V8 cannot provide effective branch coverage information, so the branches is still not perfect but close to reality.
452
+
453
+ | AST | V8 |
454
+ | :---------------------| :------------- |
455
+ | AssignmentPattern | 🛇 Not Support |
456
+ | ConditionalExpression | ✔ Not Perfect |
457
+ | IfStatement | ✔ Not Perfect |
458
+ | LogicalExpression | ✔ Not Perfect |
459
+ | SwitchStatement | ✔ Not Perfect |
460
+
451
461
  ## Istanbul Introduction
452
462
  - [Istanbul coverage report](https://istanbul.js.org/) - Instrumenting source codes and generating coverage reports
453
463
  - [babel-plugin-istanbul](https://github.com/istanbuljs/babel-plugin-istanbul)
@@ -1,5 +1,5 @@
1
1
  const path = require('path');
2
- const { fileURLToPath } = require('url');
2
+ const { fileURLToPath, pathToFileURL } = require('url');
3
3
  const Util = require('./util.js');
4
4
 
5
5
  const resolveUrl = (input) => {
@@ -36,7 +36,7 @@ const getSourcePath = (url, index = '', type = '') => {
36
36
 
37
37
  if (!url) {
38
38
  // anonymous scripts will have __playwright_evaluation_script__ as their URL.
39
- url = ['file://anonymous', index ? `-${index}` : '', type ? `.${type}` : ''].join('');
39
+ url = pathToFileURL(['anonymous', index ? `-${index}` : '', type ? `.${type}` : ''].join('')).toString();
40
40
  }
41
41
 
42
42
  if (url.startsWith('file:')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monocart-coverage-reports",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Monocart coverage reports",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {