escover 1.11.0 → 1.12.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.
package/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ 2022.01.19, v1.12.0
2
+
3
+ feature:
4
+ - escover: add lcov support
5
+
6
+
1
7
  2022.01.19, v1.11.0
2
8
 
3
9
  feature:
@@ -3,10 +3,12 @@ import {
3
3
  readFileSync,
4
4
  } from 'fs';
5
5
  import tryCatch from 'try-catch';
6
+ import {join} from 'path';
6
7
  import {getFileEntries} from '../c4.js';
7
8
  import {transform} from '../transform.js';
8
9
  import {merge} from '../merge.js';
9
10
  import {findCacheDir} from './find-cache-dir.js';
11
+ import {createLcov} from './lcov.js';
10
12
 
11
13
  const {
12
14
  stringify,
@@ -23,14 +25,16 @@ export const writeCoverage = () => {
23
25
  return;
24
26
 
25
27
  const parsed = transform(files);
26
-
27
28
  const merged = merge(parsed);
28
- const name = findCacheDir({
29
+ const lcov = createLcov(merged);
30
+
31
+ const dir = findCacheDir({
29
32
  name: NAME,
30
33
  create: true,
31
34
  });
32
35
 
33
- writeFileSync(buildName(name), stringify(merged, null, 4));
36
+ writeFileSync(join(dir, 'lcov.info'), lcov);
37
+ writeFileSync(buildName(dir), stringify(merged, null, 4));
34
38
  };
35
39
 
36
40
  export const readCoverage = () => {
@@ -9,9 +9,9 @@ export const createLcov = (files) => {
9
9
  const count = covered ? 1 : 0;
10
10
  result.push(`DA:${line},${count}`);
11
11
  }
12
-
13
- result.push('end_of_record');
14
12
  }
15
13
 
14
+ result.push('end_of_record');
15
+
16
16
  return result.join('\n');
17
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escover",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "Coverage for EcmaScript Modules",
6
6
  "main": "lib/escover.js",