monocart-coverage-reports 2.3.1 → 2.3.3

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.
@@ -39,8 +39,8 @@ const getSourcePath = (url, index = '', type = '') => {
39
39
  url = pathToFileURL(['anonymous', index ? `-${index}` : '', type ? `.${type}` : ''].join('')).toString();
40
40
  }
41
41
 
42
- // url could be a absolute path
43
- if (path.isAbsolute(url)) {
42
+ // url could be a path
43
+ if (!URL.canParse(url)) {
44
44
  url = pathToFileURL(url).toString();
45
45
  }
46
46
 
package/lib/utils/util.js CHANGED
@@ -377,11 +377,17 @@ const Util = {
377
377
  },
378
378
 
379
379
  rmSync: (p) => {
380
- if (fs.existsSync(p)) {
380
+ if (!fs.existsSync(p)) {
381
+ return;
382
+ }
383
+ try {
381
384
  fs.rmSync(p, {
382
385
  recursive: true,
383
- force: true
386
+ force: true,
387
+ maxRetries: 10
384
388
  });
389
+ } catch (err) {
390
+ console.log(err.message);
385
391
  }
386
392
  },
387
393
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monocart-coverage-reports",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "Monocart coverage reports",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -21,17 +21,22 @@
21
21
  "build-test": "node ./scripts/build-test.js",
22
22
  "build": "sf lint && sf b -p && npm run build-test",
23
23
  "test-node": "npm run test-node-env && npm run test-node-api && npm run test-node-ins && npm run test-node-cdp && npm run test-node-koa && npm run test-vm",
24
- "test-node-env": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-env node ./test/test-node-env.js && node ./test/generate-node-report.js",
24
+ "test-node-env": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-env node ./test/test-node-env.js && node ./test/generate-report.js",
25
25
  "test-node-api": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-api node ./test/test-node-api.js",
26
26
  "test-node-fgc": "node ./test/test-node-fgc.js",
27
27
  "test-node-ins": "node ./test/test-node-ins.js",
28
28
  "test-node-cdp": "node --inspect=9229 ./test/test-node-cdp.js",
29
29
  "test-node-koa": "node ./test/test-node-koa.js",
30
30
  "test-vm": "node ./test/test-vm.js",
31
- "test-browser": "node ./test/test.js",
31
+ "test-istanbul": "node ./test/test-istanbul.js",
32
+ "test-v8": "node ./test/test-v8.js",
33
+ "test-browser": "node ./test/test.js && npm run test-istanbul && npm run test-v8 && npm run test-anonymous && npm run test-css",
34
+ "test-anonymous": "node ./test/test-anonymous.js",
35
+ "test-css": "node ./test/test-css.js",
32
36
  "test-cli": "npx mcr \"node ./test/test-node-env.js\" -o docs/cli -c test/cli-options.js",
33
37
  "test-merge": "node ./test/test-merge.js",
34
- "test": "npm run test-browser && npm run test-node && npm run test-cli && npm run test-merge && npm run build-docs",
38
+ "test-all": "npm run test-browser && npm run test-node && npm run test-cli && npm run test-merge && npm run build-docs",
39
+ "test": "npx mcr \"npm run test-all\" -c test/mcr-options.js",
35
40
  "dev": "sf d v8",
36
41
  "open": "node ./scripts/open.js",
37
42
  "patch": "npm run build && sf publish patch -r"