@naturalcycles/dev-lib 13.23.1 → 13.24.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.
@@ -9,7 +9,6 @@ exports.expectResults = void 0;
9
9
  * ]).toMatchSnapshot()
10
10
  */
11
11
  function expectResults(fn, values) {
12
- // eslint-disable-next-line jest/valid-expect
13
12
  return expect(new Map(values.map(v => [v, fn(v)])));
14
13
  }
15
14
  exports.expectResults = expectResults;
@@ -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()) {
@@ -14,7 +14,6 @@ function getTSConfigPathScripts() {
14
14
  return [`./scripts/tsconfig.json`].find(p => fs.existsSync(p)) || `${paths_cnst_1.scriptsDir}/tsconfig.json`;
15
15
  }
16
16
  exports.getTSConfigPathScripts = getTSConfigPathScripts;
17
- // eslint-disable-next-line max-params
18
17
  async function runESLint(dir, eslintConfigPath, tsconfigPath, extensions = ['ts', 'tsx', 'vue'], fix = true) {
19
18
  if (!fs.existsSync(dir))
20
19
  return; // faster to bail-out like this
@@ -24,6 +23,7 @@ async function runESLint(dir, eslintConfigPath, tsconfigPath, extensions = ['ts'
24
23
  `${dir}/**/*.{${extensions.join(',')}}`,
25
24
  ...(tsconfigPath ? [`--parser-options=project:${tsconfigPath}`] : []),
26
25
  `--no-error-on-unmatched-pattern`,
26
+ `--report-unused-disable-directives`,
27
27
  fix ? `--fix` : '',
28
28
  ].filter(Boolean);
29
29
  await (0, exec_1.execWithArgs)('eslint', args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
- "version": "13.23.1",
3
+ "version": "13.24.0",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "tsn-debug": "tsn testScript.ts",