escover 3.2.2 → 3.2.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 CHANGED
@@ -1,3 +1,8 @@
1
+ 2023.05.07, v3.2.3
2
+
3
+ fix:
4
+ - f0e959e escover: add montag
5
+
1
6
  2023.05.05, v3.2.2
2
7
 
3
8
  feature:
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  [CoverageURL]: https://coveralls.io/github/coderaiser/escover?branch=master
10
10
  [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/escover/badge.svg?branch=master&service=github
11
11
 
12
- Coverage for EcmaScript Modules based on 🐊[**Putout**](https://github.com/coderaiser/putout) and [loaders](https://nodejs.org/dist/latest-v16.x/docs/api/esm.html#loaders).
12
+ Coverage for EcmaScript Modules based on 🐊[**Putout**](https://github.com/coderaiser/putout) and [loaders](https://nodejs.org/dist/latest-v20.x/docs/api/esm.html#loaders).
13
13
 
14
14
  ## Why another coverage tool?
15
15
 
package/lib/cli/cli.js CHANGED
@@ -58,7 +58,7 @@ function execute(cmd, exit) {
58
58
  env: {
59
59
  ZENLOAD: 'escover,mock-import',
60
60
  ...process.env,
61
- NODE_OPTIONS: `--no-warnings --loader zenload ${NODE_OPTIONS} `,
61
+ NODE_OPTIONS: `--no-warnings --loader zenload ${NODE_OPTIONS}`,
62
62
  },
63
63
  });
64
64
 
@@ -1,4 +1,5 @@
1
1
  import {readFileSync} from 'fs';
2
+
2
3
  const {parse} = JSON;
3
4
  const packageJson = new URL('../../package.json', import.meta.url);
4
5
 
package/lib/escover.js CHANGED
@@ -65,6 +65,7 @@ export function globalPreload({port}) {
65
65
  };
66
66
  `;
67
67
  }
68
+
68
69
  export async function load(url, context, defaultLoad) {
69
70
  const {
70
71
  format,
@@ -94,7 +95,7 @@ export async function load(url, context, defaultLoad) {
94
95
  source: rawSource,
95
96
  };
96
97
 
97
- const source = `
98
+ const source = montag`
98
99
  const __c4 = global.__createC4('${url}');
99
100
  ${instrument(url, String(rawSource))}
100
101
  `;
@@ -2,9 +2,13 @@ import putout from 'putout';
2
2
  import * as mark from './plugin-mark/index.js';
3
3
  import convertOptionalToLogical from '@putout/plugin-convert-optional-to-logical';
4
4
 
5
+ const cut = (a) => a.replace('#!/usr/bin/env node', '');
6
+
5
7
  export const instrument = (url, source) => {
6
8
  const c4 = global.__createC4(url);
7
9
 
10
+ source = cut(source);
11
+
8
12
  const {code} = putout(source, {
9
13
  printer: 'putout',
10
14
  fixCount: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "escover",
3
- "version": "3.2.2",
3
+ "version": "3.2.3",
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",