escover 2.1.2 โ 2.1.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.
- package/ChangeLog +8 -2
- package/README.md +25 -5
- package/lib/formatters/lines.js +1 -1
- package/lib/merge.js +2 -3
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
2022.05.29, v2.1.3
|
|
2
|
+
|
|
3
|
+
fix:
|
|
4
|
+
- escover: formatters: lines: add #
|
|
5
|
+
|
|
6
|
+
|
|
1
7
|
2022.05.09, v2.1.2
|
|
2
8
|
|
|
3
9
|
feature:
|
|
@@ -334,14 +340,14 @@ feature:
|
|
|
334
340
|
2022.01.08, v1.0.3
|
|
335
341
|
|
|
336
342
|
feature:
|
|
337
|
-
- escover: plugin-mark: add support
|
|
343
|
+
- escover: plugin-mark: add support of ThrowStatement
|
|
338
344
|
- escover: add merger
|
|
339
345
|
|
|
340
346
|
|
|
341
347
|
2022.01.08, v1.0.2
|
|
342
348
|
|
|
343
349
|
fix:
|
|
344
|
-
- escover:
|
|
350
|
+
- escover: improve support of AssignmentPattern
|
|
345
351
|
|
|
346
352
|
feature:
|
|
347
353
|
- escover: plugin-mark-line -> plugin-mark
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ you have a couple problems to solve.
|
|
|
26
26
|
|
|
27
27
|
### ๐คทโ How to get coverage when `nyc` doesn't supported?
|
|
28
28
|
|
|
29
|
-
โ๏ธ `c8` could help, but [no](https://github.com/coderaiser/c8-reproduce) it supports no `query
|
|
29
|
+
โ๏ธ `c8` could help, but [no](https://github.com/coderaiser/c8-reproduce) it supports no `query parameters`
|
|
30
30
|
which are needed to load module again, and apply mocks.
|
|
31
31
|
|
|
32
32
|
### ๐คทโ How to get coverage when mocks are used?
|
|
@@ -35,7 +35,7 @@ which are needed to load module again, and apply mocks.
|
|
|
35
35
|
|
|
36
36
|
### ๐คทโ What with [`coveralls`](https://coveralls.io/)? Does [`lcov`](https://github.com/StevenLooman/mocha-lcov-reporter) supported?
|
|
37
37
|
|
|
38
|
-
โ๏ธ Sure! `coverage/lcov.info` is main coverage file for
|
|
38
|
+
โ๏ธ Sure! `coverage/lcov.info` is main coverage file for ๐ฉ**ESCover**.
|
|
39
39
|
|
|
40
40
|
## Install
|
|
41
41
|
|
|
@@ -49,6 +49,26 @@ Run to collect and show coverage:
|
|
|
49
49
|
escover npm test
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
## Comparison with `c8`
|
|
53
|
+
|
|
54
|
+
Check out the real example from [wisdom](https://github.com/coderaiser/wisdom). There is next uncovered code:
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
import jessy from 'jessy';
|
|
58
|
+
|
|
59
|
+
export default (info) => typeof jessy('publishConfig.access', info) === 'undefined';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`c8` shows three columns with 100% and one with 0%.
|
|
63
|
+
|
|
64
|
+
<img width="584" alt="image" src="https://user-images.githubusercontent.com/1573141/169064257-579d6770-095e-475b-a7bc-8275849c8dc2.png">
|
|
65
|
+
|
|
66
|
+
And here is what you will see with ๐ฉ**ESCover**:
|
|
67
|
+
|
|
68
|
+
<img width="403" alt="image" src="https://user-images.githubusercontent.com/1573141/169064550-62aa2398-b370-496f-8c8b-418d0d2d6004.png">
|
|
69
|
+
|
|
70
|
+
So if you need more accurate code with no bullshit green 100%, use ๐ฉ**ESCover** ๐.
|
|
71
|
+
|
|
52
72
|
## Config
|
|
53
73
|
|
|
54
74
|
`exclude` section of configuration file `.nyrc.json` supported.
|
|
@@ -84,9 +104,9 @@ Then run:
|
|
|
84
104
|
NODE_OPTIONS="'--loader zenlend'" ZENLOAD='escover,mock-import' escover npm test
|
|
85
105
|
```
|
|
86
106
|
|
|
87
|
-
## What
|
|
107
|
+
## What should I know about `lcov`?
|
|
88
108
|
|
|
89
|
-
Format used by
|
|
109
|
+
Format used by ๐ฉ**ESCover** located in `coverage/lcov.info`.
|
|
90
110
|
|
|
91
111
|
- โ๏ธ *[`lcov`](https://github.com/linux-test-project/lcov) was created in `2002`, twenty years ago.*
|
|
92
112
|
- โ๏ธ *Linux kernel developers created it to know what is going on with the coverage.*
|
|
@@ -122,7 +142,7 @@ Where:
|
|
|
122
142
|
|
|
123
143
|
- `SF` - is path to source;
|
|
124
144
|
- `DA` - is line number, and count of running;
|
|
125
|
-
- `end_of_record` latest
|
|
145
|
+
- `end_of_record` latest recorded for current file entry;
|
|
126
146
|
|
|
127
147
|
The only thing that is differ from `lcov`: counters are `0` or `1`, if you have a reason to use "real" counters [create an issue](https://github.com/coderaiser/escover/issues/new).
|
|
128
148
|
|
package/lib/formatters/lines.js
CHANGED
package/lib/merge.js
CHANGED
|
@@ -5,13 +5,12 @@ export const merge = (files) => {
|
|
|
5
5
|
|
|
6
6
|
for (const {rawName, rawLines} of files) {
|
|
7
7
|
const name = cutQuery(rawName);
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
deduplicator[name] = applyCoverage({
|
|
9
10
|
name,
|
|
10
11
|
rawLines,
|
|
11
12
|
deduplicator,
|
|
12
13
|
});
|
|
13
|
-
|
|
14
|
-
deduplicator[name] = lines;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
const list = [];
|