@jsenv/test 1.3.0 → 1.4.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.
@@ -799,7 +799,7 @@ function safeDefineProperty(object, propertyNameOrSymbol, descriptor) {
799
799
  * So the best solution remains NODE_V8_COVERAGE
800
800
  * This profiler strategy remains useful when:
801
801
  * - As fallback when NODE_V8_COVERAGE is not configured
802
- * - If explicitely enabled with coverageMethodForNodeJs: 'Profiler'
802
+ * - If explicitely enabled with coverageMethodForNodeJs: "Profiler"
803
803
  * - Used by jsenv during automated tests about coverage
804
804
  * - Anyone prefering this approach over NODE_V8_COVERAGE and assuming
805
805
  * it will not fork subprocess or don't care if coverage is missed for this code
@@ -1919,7 +1919,7 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
1919
1919
  }
1920
1920
 
1921
1921
  if ('CI' in env) {
1922
- if ('GITHUB_ACTIONS' in env) {
1922
+ if ('GITHUB_ACTIONS' in env || 'GITEA_ACTIONS' in env) {
1923
1923
  return 3;
1924
1924
  }
1925
1925
 
@@ -3361,7 +3361,7 @@ const relativeUrlToEmptyCoverage = async (
3361
3361
  const { metadata } = await applyBabelPlugins({
3362
3362
  babelPlugins: [babelPluginInstrument],
3363
3363
  input: content,
3364
- inputIsJsModule: false,
3364
+ inputIsJsModule: true,
3365
3365
  inputUrl: fileUrl,
3366
3366
  });
3367
3367
  const { coverage } = metadata;
@@ -4297,7 +4297,7 @@ const executeSteps = async (
4297
4297
  rootDirectoryUrl,
4298
4298
  coverageConfig,
4299
4299
  coverageIncludeMissing,
4300
- coverageMethodForBrowsers,
4300
+ coverageMethodForNodeJs,
4301
4301
  coverageV8ConflictWarning,
4302
4302
  });
4303
4303
  executePlanReturnValue.planCoverage = planCoverage;
@@ -4384,6 +4384,10 @@ const executeSteps = async (
4384
4384
  status: "executing",
4385
4385
  },
4386
4386
  };
4387
+ if (typeof executionParams.allocatedMs === "function") {
4388
+ executionParams.allocatedMs =
4389
+ executionParams.allocatedMs(beforeExecutionInfo);
4390
+ }
4387
4391
  let spinner;
4388
4392
  if (executionSpinner) {
4389
4393
  spinner = startSpinner({
@@ -4413,10 +4417,7 @@ const executeSteps = async (
4413
4417
  executionResult = await run({
4414
4418
  signal: multipleExecutionsOperation.signal,
4415
4419
  logger,
4416
- allocatedMs:
4417
- typeof executionParams.allocatedMs === "function"
4418
- ? executionParams.allocatedMs(beforeExecutionInfo)
4419
- : executionParams.allocatedMs,
4420
+ allocatedMs: executionParams.allocatedMs,
4420
4421
  keepRunning,
4421
4422
  mirrorConsole: false, // file are executed in parallel, log would be a mess to read
4422
4423
  collectConsole: executionParams.collectConsole,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/test",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,11 +34,11 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@jsenv/abort": "4.2.4",
37
- "@jsenv/ast": "4.1.0",
38
- "@jsenv/filesystem": "4.2.3",
39
- "@jsenv/log": "3.3.5",
40
- "@jsenv/plugin-supervisor": "1.1.1",
41
- "@jsenv/urls": "2.0.0",
37
+ "@jsenv/ast": "5.0.0",
38
+ "@jsenv/filesystem": "4.2.4",
39
+ "@jsenv/log": "3.4.0",
40
+ "@jsenv/plugin-supervisor": "1.2.0",
41
+ "@jsenv/urls": "2.1.0",
42
42
  "@jsenv/url-meta": "8.1.0",
43
43
  "@jsenv/uneval": "1.6.0",
44
44
  "@jsenv/utils": "2.0.1",
@@ -21,7 +21,7 @@ export const relativeUrlToEmptyCoverage = async (
21
21
  const { metadata } = await applyBabelPlugins({
22
22
  babelPlugins: [babelPluginInstrument],
23
23
  input: content,
24
- inputIsJsModule: false,
24
+ inputIsJsModule: true,
25
25
  inputUrl: fileUrl,
26
26
  });
27
27
  const { coverage } = metadata;
@@ -104,7 +104,7 @@ export const executeSteps = async (
104
104
  rootDirectoryUrl,
105
105
  coverageConfig,
106
106
  coverageIncludeMissing,
107
- coverageMethodForBrowsers,
107
+ coverageMethodForNodeJs,
108
108
  coverageV8ConflictWarning,
109
109
  });
110
110
  executePlanReturnValue.planCoverage = planCoverage;
@@ -191,6 +191,10 @@ export const executeSteps = async (
191
191
  status: "executing",
192
192
  },
193
193
  };
194
+ if (typeof executionParams.allocatedMs === "function") {
195
+ executionParams.allocatedMs =
196
+ executionParams.allocatedMs(beforeExecutionInfo);
197
+ }
194
198
  let spinner;
195
199
  if (executionSpinner) {
196
200
  spinner = startSpinner({
@@ -220,10 +224,7 @@ export const executeSteps = async (
220
224
  executionResult = await run({
221
225
  signal: multipleExecutionsOperation.signal,
222
226
  logger,
223
- allocatedMs:
224
- typeof executionParams.allocatedMs === "function"
225
- ? executionParams.allocatedMs(beforeExecutionInfo)
226
- : executionParams.allocatedMs,
227
+ allocatedMs: executionParams.allocatedMs,
227
228
  keepRunning,
228
229
  mirrorConsole: false, // file are executed in parallel, log would be a mess to read
229
230
  collectConsole: executionParams.collectConsole,
@@ -4,7 +4,7 @@
4
4
  * So the best solution remains NODE_V8_COVERAGE
5
5
  * This profiler strategy remains useful when:
6
6
  * - As fallback when NODE_V8_COVERAGE is not configured
7
- * - If explicitely enabled with coverageMethodForNodeJs: 'Profiler'
7
+ * - If explicitely enabled with coverageMethodForNodeJs: "Profiler"
8
8
  * - Used by jsenv during automated tests about coverage
9
9
  * - Anyone prefering this approach over NODE_V8_COVERAGE and assuming
10
10
  * it will not fork subprocess or don't care if coverage is missed for this code