monocart-coverage-reports 2.11.3 → 2.11.5
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 +8 -0
- package/README.zh-Hans.md +8 -0
- package/lib/converter/collect-source-maps.js +2 -2
- package/lib/converter/untested.js +3 -3
- package/lib/packages/monocart-coverage-assets.js +1 -1
- package/lib/packages/monocart-coverage-vendor.js +1 -1
- package/lib/platform/share.js +24 -0
- package/lib/reports/console-details.js +2 -3
- package/lib/utils/source-path.js +12 -2
- package/lib/utils/util.js +36 -4
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -966,6 +966,14 @@ When `logging` is `debug`, the raw report data will be preserved in `[outputDir]
|
|
|
966
966
|
|
|
967
967
|

|
|
968
968
|
|
|
969
|
+
- Generate additional source and sourcemap files to cache or raw dir
|
|
970
|
+
```js
|
|
971
|
+
const coverageOptions = {
|
|
972
|
+
logging: 'debug',
|
|
973
|
+
sourceMap: true
|
|
974
|
+
};
|
|
975
|
+
```
|
|
976
|
+
|
|
969
977
|
- Show time logs with env `MCR_LOG_TIME`
|
|
970
978
|
```js
|
|
971
979
|
process.env.MCR_LOG_TIME = true
|
package/README.zh-Hans.md
CHANGED
|
@@ -969,6 +969,14 @@ const coverageOptions = {
|
|
|
969
969
|
|
|
970
970
|

|
|
971
971
|
|
|
972
|
+
- 生成额外的source和sourcemap文件到cache或raw文件夹
|
|
973
|
+
```js
|
|
974
|
+
const coverageOptions = {
|
|
975
|
+
logging: 'debug',
|
|
976
|
+
sourceMap: true
|
|
977
|
+
};
|
|
978
|
+
```
|
|
979
|
+
|
|
972
980
|
- 使用环境变量`MCR_LOG_TIME`显示时间日志
|
|
973
981
|
```js
|
|
974
982
|
process.env.MCR_LOG_TIME = true
|
|
@@ -17,7 +17,7 @@ const loadSourceMap = async (url = '') => {
|
|
|
17
17
|
Util.logDebug(EC.red(`failed to load sourcemap ${p}`));
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return Util.jsonParse(content);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const [err, res] = await Util.request(url);
|
|
@@ -31,7 +31,7 @@ const loadSourceMap = async (url = '') => {
|
|
|
31
31
|
|
|
32
32
|
// could be string not json, if Content-Type is application/octet-stream
|
|
33
33
|
if (typeof content === 'string') {
|
|
34
|
-
return
|
|
34
|
+
return Util.jsonParse(content);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
return content;
|
|
@@ -7,7 +7,7 @@ const { pathToFileURL, fileURLToPath } = require('url');
|
|
|
7
7
|
const { normalizeSourcePath, getSourcePathReplacer } = require('../utils/source-path.js');
|
|
8
8
|
|
|
9
9
|
// const EC = require('eight-colors');
|
|
10
|
-
const {
|
|
10
|
+
const { convertSourceMap } = require('../packages/monocart-coverage-vendor.js');
|
|
11
11
|
|
|
12
12
|
// ========================================================================================================
|
|
13
13
|
|
|
@@ -37,7 +37,7 @@ const resolveAllFilter = (input) => {
|
|
|
37
37
|
input = obj;
|
|
38
38
|
} else {
|
|
39
39
|
return (filePath) => {
|
|
40
|
-
return
|
|
40
|
+
return Util.betterMinimatch(filePath, input);
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -47,7 +47,7 @@ const resolveAllFilter = (input) => {
|
|
|
47
47
|
const patterns = Object.keys(input);
|
|
48
48
|
return (filePath) => {
|
|
49
49
|
for (const pattern of patterns) {
|
|
50
|
-
if (
|
|
50
|
+
if (Util.betterMinimatch(filePath, pattern)) {
|
|
51
51
|
return input[pattern];
|
|
52
52
|
}
|
|
53
53
|
}
|