@naturalcycles/dev-lib 13.52.1 → 13.54.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/cfg/_cnst.js +1 -1
- package/dist/util/jest.util.js +3 -13
- package/package.json +3 -3
- package/readme.md +1 -1
package/cfg/_cnst.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
prettierDirs: [
|
|
3
|
-
'src,scripts,e2e,playwright,docs,cfg,resources,.
|
|
3
|
+
'src,scripts,e2e,playwright,docs,cfg,resources,.github,public,static,components,content,layouts,pages,plugins,middleware,store,blocks',
|
|
4
4
|
],
|
|
5
5
|
// ts,tsx,css,scss excluded, cause they need to run in special order (overlap between >1 tool):
|
|
6
6
|
prettierExtensionsExclusive: 'js,jsx,json,md,graphql,yml,yaml,html',
|
package/dist/util/jest.util.js
CHANGED
|
@@ -42,7 +42,7 @@ function runJest(opt = {}) {
|
|
|
42
42
|
console.log((0, nodejs_lib_1.dimGrey)(`node_modules/${(0, nodejs_lib_1.white)('jest')} not found, skipping tests`));
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
const { CI,
|
|
45
|
+
const { CI, CPU_LIMIT, TZ = 'UTC', APP_ENV, JEST_NO_ALPHABETIC, JEST_SHARDS, NODE_OPTIONS = 'not defined', } = process.env;
|
|
46
46
|
const { node } = process.versions;
|
|
47
47
|
const cpuLimit = Number(CPU_LIMIT) || undefined;
|
|
48
48
|
const { integration, manual, leaks } = opt;
|
|
@@ -76,18 +76,8 @@ function runJest(opt = {}) {
|
|
|
76
76
|
// Coverage only makes sense for unit tests, not for integration/manual
|
|
77
77
|
args.push('--coverage');
|
|
78
78
|
}
|
|
79
|
-
if (!maxWorkers) {
|
|
80
|
-
|
|
81
|
-
maxWorkers = `--maxWorkers=${cpuLimit - 1}`;
|
|
82
|
-
}
|
|
83
|
-
else if (CIRCLECI) {
|
|
84
|
-
// We used to default to 2, but due to memory being an issue for Jest - now we default to 1,
|
|
85
|
-
// as it's the most memory-efficient way
|
|
86
|
-
// Since `workerIdleMemoryLimit` was introduced by default - we're changing default back to 2 workers
|
|
87
|
-
// We now only do it for CircleCI (not for CI in general), as it reports cpus as 36
|
|
88
|
-
// Github Actions don't do that and report correct number of cpus
|
|
89
|
-
maxWorkers = '--maxWorkers=2';
|
|
90
|
-
}
|
|
79
|
+
if (!maxWorkers && cpuLimit && cpuLimit > 1) {
|
|
80
|
+
maxWorkers = `--maxWorkers=${cpuLimit - 1}`;
|
|
91
81
|
}
|
|
92
82
|
}
|
|
93
83
|
// Running all tests - will use `--silent` to suppress console-logs, will also set process.env.JEST_SILENT=1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/dev-lib",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.54.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepare": "husky",
|
|
6
6
|
"tsn-debug": "tsn testScript.ts",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"eslint-plugin-import": "^2.22.1",
|
|
45
45
|
"eslint-plugin-jest": "^28.0.0",
|
|
46
46
|
"eslint-plugin-jsdoc": "^48.0.1",
|
|
47
|
-
"eslint-plugin-unicorn": "^
|
|
48
|
-
"eslint-plugin-unused-imports": "^
|
|
47
|
+
"eslint-plugin-unicorn": "^54.0.0",
|
|
48
|
+
"eslint-plugin-unused-imports": "^4.0.0",
|
|
49
49
|
"eslint-plugin-vue": "^9.0.0",
|
|
50
50
|
"expect-type": "^0.19.0",
|
|
51
51
|
"husky": "^9.0.2",
|
package/readme.md
CHANGED
|
@@ -99,7 +99,7 @@ adds `--silent` (and `JEST_SILENT` env var) if all tests are run.
|
|
|
99
99
|
|
|
100
100
|
- `test`: runs unit tests (all tests _except_ `*.integration.test.ts` and `*.manual.test.ts`).
|
|
101
101
|
Detects `CI` env variable, adds `--coverage` if in CI. Uses `default` reporter in `!CI`, otherwise
|
|
102
|
-
`jest-junit` reporter.
|
|
102
|
+
`jest-junit` reporter.
|
|
103
103
|
- `test-integration`: runs `*.integration.test.ts` with `jest.integration-test.config.js` config.
|
|
104
104
|
- `test-manual`: runs `*.manual.test.ts` with `jest.manual-test.config.js`.
|
|
105
105
|
- `test-leaks`: runs Jest with `--logHeapUsage --detectOpenHandles --detectLeaks`.
|