escover 1.1.2 → 1.1.6

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,28 @@
1
+ 2022.01.14, v1.1.6
2
+
3
+ fix:
4
+ - npmignore: add fixture
5
+
6
+
7
+ 2022.01.14, v1.1.5
8
+
9
+ fix:
10
+ - escover: set zenload as dependency
11
+
12
+
13
+ 2022.01.13, v1.1.4
14
+
15
+ feature:
16
+ - (package) eslint-plugin-putout v13.0.1
17
+ - (package) putout v24.0.2
18
+
19
+
20
+ 2022.01.11, v1.1.3
21
+
22
+ fix:
23
+ - escover: rm unused
24
+
25
+
1
26
  2022.01.11, v1.1.2
2
27
 
3
28
  fix:
package/README.md CHANGED
@@ -17,16 +17,20 @@ When you want to use `ESM` in `Node.js` without transpiling to `CommonJS` (that'
17
17
  you have a couple problems to solve.
18
18
 
19
19
  ### 🤷‍ What test runner does no transpiling to `CommonJS`?
20
+
20
21
  ☝️ that's easy! 📼 [`Supertape`](https://github.com/coderaiser/supertape) supports `ESM` from the box;
21
22
 
22
23
  ### 🤷‍ How to mock modules without [mock-require](https://github.com/boblauer/mock-require) (we in `ESM`!);
24
+
23
25
  ☝️ that's solved! [`mock-import`](https://github.com/coderaiser/mock-import) does the thing using `loaders`;
24
26
 
25
27
  ### 🤷‍ How to get coverage when `nyc` doesn't supported?
28
+
26
29
  ☝️ `c8` could help, but [no](https://github.com/coderaiser/c8-reproduce) it supports no `query paramters`
27
30
  which are needed to load module again, and apply mocks.
28
31
 
29
32
  ### 🤷‍ How to get coverage when mocks are used?
33
+
30
34
  ☝️ Use 🎩 `ESCover`! It supports loaders, `ESM` and collects coverage as a loader!
31
35
 
32
36
  ## Install
package/lib/cli/cli.js CHANGED
@@ -1,23 +1,10 @@
1
- import {
2
- execSync,
3
- spawnSync,
4
- } from 'child_process';
5
- import {promisify} from 'util';
1
+ import {execSync} from 'child_process';
6
2
  import tryCatch from 'try-catch';
7
3
  import yargsParser from 'yargs-parser';
8
- import _foreground from 'foreground-child';
9
4
 
10
5
  import {version} from './version.js';
11
6
  import {report} from '../report.js';
12
7
 
13
- const foreground = promisify((cmd, fn) => {
14
- _foreground(cmd, (done) => {
15
- fn();
16
- });
17
- });
18
-
19
- process.env.ZENLOAD = 'escover,mock-import';
20
-
21
8
  export const cli = ({argv, exit, read}) => {
22
9
  const args = yargsParser(argv.slice(2), {
23
10
  boolean: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escover",
3
- "version": "1.1.2",
3
+ "version": "1.1.6",
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",
@@ -41,9 +41,10 @@
41
41
  "find-up": "^6.2.0",
42
42
  "montag": "^1.2.1",
43
43
  "once": "^1.4.0",
44
- "putout": "^23.5.0",
44
+ "putout": "^24.0.2",
45
45
  "try-catch": "^3.0.0",
46
- "yargs-parser": "^21.0.0"
46
+ "yargs-parser": "^21.0.0",
47
+ "zenload": "^1.4.0"
47
48
  },
48
49
  "engines": {
49
50
  "node": ">=14"
@@ -55,10 +56,9 @@
55
56
  "escover": ".",
56
57
  "eslint": "^8.3.0",
57
58
  "eslint-plugin-node": "^11.1.0",
58
- "eslint-plugin-putout": "^12.2.0",
59
+ "eslint-plugin-putout": "^13.0.1",
59
60
  "madrun": "^8.8.1",
60
61
  "mock-import": "^2.0.0",
61
- "supertape": "^6.0.5",
62
- "zenload": "^1.0.0"
62
+ "supertape": "^6.0.5"
63
63
  }
64
64
  }
@@ -1,9 +0,0 @@
1
- const {__c4} = global;
2
- __c4.mark(1, 0), cli({
3
- stdout,
4
- stderr,
5
- exit,
6
- cwd: (__c4.mark(5, 9), process.cwd()),
7
- argv: (__c4.mark(6, 10), process.argv.slice(2))
8
- });
9
-
@@ -1,8 +0,0 @@
1
- cli({
2
- stdout,
3
- stderr,
4
- exit,
5
- cwd: process.cwd(),
6
- argv: process.argv.slice(2)
7
- })
8
-
@@ -1,6 +0,0 @@
1
- export const nothing = (a, b) => {
2
- return __c4['🧨'](2, 4);
3
- };
4
- export const sum = (a, b) => {
5
- return __c4['🧨'](5, 4), a + b;
6
- };
@@ -1,6 +0,0 @@
1
- export const nothing = (a, b) => {
2
- return;
3
- };
4
- export const sum = (a, b) => {
5
- return a + b;
6
- };
@@ -1,2 +0,0 @@
1
- const [error, {packageJson} = (__c4['🧨'](1, 14), {})] = (__c4['🧨'](1, 36), tryCatch(readPackageUpSync));
2
- data += (__c4['🧨'](2, 0), 'fix:' + '\n');
@@ -1,2 +0,0 @@
1
- const [error, {packageJson} = {}] = tryCatch(readPackageUpSync);
2
- data += 'fix:' + '\n';
@@ -1,6 +0,0 @@
1
- if (error) {
2
- throw (__c4['🧨'](2, 4), `error reading package.json: ${error.message}`);
3
- }
4
-
5
- if (error)
6
- throw (__c4['🧨'](6, 4), (__c4.mark(11, 8), `error reading package.json: ${error.message}`));
@@ -1,6 +0,0 @@
1
- if (error) {
2
- throw `error reading package.json: ${error.message}`;
3
- }
4
-
5
- if (error)
6
- throw (__c4.mark(11, 8), `error reading package.json: ${error.message}`);
@@ -1,3 +0,0 @@
1
- if ((__c4['🧨'](1, 4), a) || (__c4['🧨'](1, 9), b)) {
2
- __c4['🧨'](1, 12);
3
- }
@@ -1,2 +0,0 @@
1
- if (a || b) {
2
- }
@@ -1,30 +0,0 @@
1
- const a = () => {
2
- a = (__c4['🧨'](2, 4), 5);
3
- __c4['🧨'](3, 4), console.log(5);
4
- };
5
-
6
-
7
- function x() {
8
-
9
- if (a > 2) {
10
- __c4['🧨'](9, 14), a();
11
- } else {
12
- __c4['🧨'](10, 9), b();
13
- }
14
- }
15
-
16
- for (const x of y) {
17
- __c4['🧨'](13, 19);
18
- }
19
-
20
- const ax = ((__c4['🧨'](16, 12), a()), (__c4['🧨'](16, 17), b()));
21
- const bx = (c, (__c4['🧨'](17, 15), d()));
22
-
23
- if ((__c4['🧨'](19, 4), a) || (__c4['🧨'](19, 9), b)) {
24
- __c4['🧨'](19, 12);
25
- }
26
-
27
-
28
- function x1(a, b = (__c4['🧨'](23, 15), 5)) {
29
- __c4['🧨'](23, 22);
30
- }
@@ -1,24 +0,0 @@
1
- const a = () => {
2
- a = 5;
3
- console.log(5);
4
- };
5
-
6
-
7
- function x() {
8
-
9
- if (a > 2)a()
10
- else b();
11
- }
12
-
13
- for (const x of y) {
14
- }
15
-
16
- const ax = (a(), b());
17
- const bx = (c, d());
18
-
19
- if (a || b) {
20
- }
21
-
22
-
23
- function x1(a, b = 5) {
24
- }
@@ -1 +0,0 @@
1
- const files = (__c4['🧨'](1, 14), new Map());
@@ -1 +0,0 @@
1
- const files = new Map();
@@ -1,8 +0,0 @@
1
- __c4['🧨'](1, 0), cli({
2
- stdout,
3
- stderr,
4
- exit,
5
- cwd: (__c4['🧨'](5, 9), process.cwd()),
6
- argv: (__c4['🧨'](6, 10), process.argv.slice(2))
7
- });
8
-
@@ -1,8 +0,0 @@
1
- cli({
2
- stdout,
3
- stderr,
4
- exit,
5
- cwd: process.cwd(),
6
- argv: process.argv.slice(2)
7
- })
8
-