@naturalcycles/dev-lib 16.2.2 → 16.3.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/dist/test.util.js CHANGED
@@ -19,6 +19,7 @@ function runTest(opt = {}) {
19
19
  }
20
20
  function runVitest(opt) {
21
21
  const { integration, manual } = opt;
22
+ const { CPU_LIMIT } = process.env;
22
23
  const processArgs = process.argv.slice(3);
23
24
  const args = [...processArgs];
24
25
  const env = {};
@@ -32,6 +33,13 @@ function runVitest(opt) {
32
33
  TEST_TYPE: 'manual',
33
34
  });
34
35
  }
36
+ if (CPU_LIMIT) {
37
+ const cpuLimit = Number(CPU_LIMIT);
38
+ Object.assign(env, {
39
+ VITEST_MIN_FORKS: cpuLimit,
40
+ VITEST_MAX_FORKS: cpuLimit,
41
+ });
42
+ }
35
43
  nodejs_lib_1.exec2.spawn('vitest', {
36
44
  args: (0, js_lib_1._uniq)(args),
37
45
  logFinish: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
- "version": "16.2.2",
3
+ "version": "16.3.0",
4
4
  "scripts": {
5
5
  "prepare": "husky",
6
6
  "tsn-debug": "tsn testScript.ts",