escover 2.3.0 → 2.5.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,21 @@
1
+ 2022.07.30, v2.5.0
2
+
3
+ feature:
4
+ - escover: add ability to handle multiple load
5
+
6
+ 2022.07.30, v2.4.0
7
+
8
+ feature:
9
+ - (escover) mark: improve support of ArrowFunctionExpressions
10
+
11
+ 2022.07.20, v2.3.1
12
+
13
+ feature:
14
+ - package: putout v27.0.1
15
+ - package: eslint-plugin-n v15.2.4
16
+ - package: eslint-plugin-putout v16.0.0
17
+
18
+
1
19
  2022.07.01, v2.3.0
2
20
 
3
21
  feature:
package/README.md CHANGED
@@ -115,7 +115,7 @@ NODE_OPTIONS="'--loader zenlend'" ZENLOAD='escover,mock-import' escover npm test
115
115
  If you want to disable coverage on status code without erroring, use `ESCOVER_SUCCESS_EXIT_CODE`:
116
116
 
117
117
  ```js
118
- import {SKIPPED} from 'supertape/exit-codes';
118
+ import {SKIPED} from 'supertape/exit-codes';
119
119
 
120
120
  const env = {
121
121
  ESCOVER_SUCCESS_EXIT_CODE: SKIPPED,
package/lib/escover.js CHANGED
@@ -1,4 +1,3 @@
1
- import montag from 'montag';
2
1
  import process from 'process';
3
2
 
4
3
  import {instrument} from './instrument/index.js';
@@ -45,7 +44,13 @@ export async function load(url, context, defaultLoad) {
45
44
  source: rawSource,
46
45
  };
47
46
 
48
- const source = montag`
47
+ if (rawSource.includes('const __c4'))
48
+ return {
49
+ format,
50
+ source: rawSource,
51
+ };
52
+
53
+ const source = `
49
54
  const __c4 = global.__createC4('${url}');
50
55
  ${instrument(url, rawSource)}
51
56
  `;
@@ -8,6 +8,7 @@ import * as mark from './plugin-mark/index.js';
8
8
  export const instrument = (url, source) => {
9
9
  const c4 = global.__createC4(url);
10
10
  const options = {
11
+ fixCount: 1,
11
12
  rules: {
12
13
  mark: ['on', {
13
14
  c4,
@@ -144,7 +144,12 @@ export const traverse = ({push}) => ({
144
144
  push(path);
145
145
  },
146
146
  ArrowFunctionExpression(path) {
147
- if (path.get('body').isBlockStatement())
147
+ const bodyPath = path.get('body');
148
+
149
+ if (bodyPath.isBlockStatement())
150
+ return;
151
+
152
+ if (isExclude(bodyPath))
148
153
  return;
149
154
 
150
155
  push(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escover",
3
- "version": "2.3.0",
3
+ "version": "2.5.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",
@@ -47,7 +47,7 @@
47
47
  "montag": "^1.2.1",
48
48
  "once": "^1.4.0",
49
49
  "picomatch": "^2.3.1",
50
- "putout": "^26.0.0",
50
+ "putout": "^27.0.1",
51
51
  "strip-ansi": "^7.0.1",
52
52
  "table": "^6.8.0",
53
53
  "try-catch": "^3.0.0",
@@ -63,8 +63,8 @@
63
63
  "c8": "^7.8.0",
64
64
  "escover": "^2.0.1",
65
65
  "eslint": "^8.3.0",
66
- "eslint-plugin-node": "^11.1.0",
67
- "eslint-plugin-putout": "^15.1.1",
66
+ "eslint-plugin-n": "^15.2.4",
67
+ "eslint-plugin-putout": "^16.0.0",
68
68
  "madrun": "^9.0.0",
69
69
  "supertape": "^7.0.0"
70
70
  }