escover 1.5.2 → 1.6.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.17, v1.6.0
2
+
3
+ feature:
4
+ - escover: add sorting
5
+
6
+
1
7
  2022.01.17, v1.5.2
2
8
 
3
9
  fix:
package/lib/cli/cli.js CHANGED
@@ -6,6 +6,8 @@ import {version} from './version.js';
6
6
  import reportLines from '../formatters/lines.js';
7
7
  import reportFiles from '../formatters/files.js';
8
8
 
9
+ const {ESCOVER_FORMAT, NODE_OPTIONS = ''} = process.env;
10
+
9
11
  export const cli = ({argv, exit, read}) => {
10
12
  const args = yargsParser(argv.slice(2), {
11
13
  string: [
@@ -19,7 +21,7 @@ export const cli = ({argv, exit, read}) => {
19
21
  f: 'format',
20
22
  },
21
23
  default: {
22
- format: 'files',
24
+ format: ESCOVER_FORMAT || 'files',
23
25
  },
24
26
  });
25
27
 
@@ -46,9 +48,9 @@ function execute(cmd, exit) {
46
48
  const [error] = tryCatch(execSync, cmd, {
47
49
  stdio: [0, 1, 2],
48
50
  env: {
49
- NODE_OPTIONS: '--no-warnings --loader zenload',
50
51
  ZENLOAD: 'escover,mock-import',
51
52
  ...process.env,
53
+ NODE_OPTIONS: `--no-warnings --loader zenload ${NODE_OPTIONS} `,
52
54
  },
53
55
  });
54
56
 
package/lib/transform.js CHANGED
@@ -1,7 +1,10 @@
1
+ const sort = (a) => new Map(Array.from(a.entries()).sort());
2
+
1
3
  export const transform = (files) => {
2
4
  const result = [];
5
+ const sorted = sort(files);
3
6
 
4
- for (const [rawName, places] of files.entries()) {
7
+ for (const [rawName, places] of sorted.entries()) {
5
8
  const rawLines = {};
6
9
 
7
10
  for (const [place, covered] of places.entries()) {
@@ -18,3 +21,4 @@ export const transform = (files) => {
18
21
 
19
22
  return result;
20
23
  };
24
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escover",
3
- "version": "1.5.2",
3
+ "version": "1.6.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",