@naturalcycles/dev-lib 13.23.1 → 13.23.2

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.
@@ -42,7 +42,7 @@ async function runJest(opt = {}) {
42
42
  console.log((0, colors_1.dimGrey)(`node_modules/${(0, colors_1.white)('jest')} not found, skipping tests`));
43
43
  return;
44
44
  }
45
- const { CI, TZ = 'UTC', APP_ENV, JEST_NO_ALPHABETIC, JEST_SHARDS, NODE_OPTIONS = 'not defined', } = process.env;
45
+ const { CI, CIRCLECI, TZ = 'UTC', APP_ENV, JEST_NO_ALPHABETIC, JEST_SHARDS, NODE_OPTIONS = 'not defined', } = process.env;
46
46
  const { node } = process.versions;
47
47
  const { integration, manual, leaks } = opt;
48
48
  const processArgs = process.argv.slice(2);
@@ -75,10 +75,14 @@ async function runJest(opt = {}) {
75
75
  // Coverage only makes sense for unit tests, not for integration/manual
76
76
  args.push('--coverage');
77
77
  }
78
- // We used to default to 2, but due to memory being an issue for Jest - now we default to 1,
79
- // as it's the most memory-efficient way
80
- // Since `workerIdleMemoryLimit` was introduced by default - we're changing default back to 2 workers
81
- maxWorkers ||= '--maxWorkers=2';
78
+ if (CIRCLECI) {
79
+ // We used to default to 2, but due to memory being an issue for Jest - now we default to 1,
80
+ // as it's the most memory-efficient way
81
+ // Since `workerIdleMemoryLimit` was introduced by default - we're changing default back to 2 workers
82
+ // We now only do it for CircleCI (not for CI in general), as it reports cpus as 36
83
+ // Github Actions don't do that and report correct number of cpus
84
+ maxWorkers ||= '--maxWorkers=2';
85
+ }
82
86
  }
83
87
  // Running all tests - will use `--silent` to suppress console-logs, will also set process.env.JEST_SILENT=1
84
88
  if (CI || isRunningAllTests()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
- "version": "13.23.1",
3
+ "version": "13.23.2",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "tsn-debug": "tsn testScript.ts",