@ornikar/jest-config-react 10.0.0 → 10.1.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/CHANGELOG.md +24 -0
- package/__mocks__/@storybook/react.js +4 -2
- package/jest-preset.js +6 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [10.1.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.0.1...@ornikar/jest-config-react@10.1.0) (2022-11-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **jest-config-react:** fix testing library cleanup ECF-58 ([#804](https://github.com/ornikar/shared-configs/issues/804)) ([c23b3f4](https://github.com/ornikar/shared-configs/commit/c23b3f4d7742e40cd8e63b31f1273926185376ad))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **jest-config-react:** configure default max workers ECF-61 ([#805](https://github.com/ornikar/shared-configs/issues/805)) ([779f48c](https://github.com/ornikar/shared-configs/commit/779f48c43e464b03482e23b1f9d4c101ed37141c))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [10.0.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.0.0...@ornikar/jest-config-react@10.0.1) (2022-10-28)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @ornikar/jest-config-react
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [10.0.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@9.6.4...@ornikar/jest-config-react@10.0.0) (2022-08-17)
|
|
7
31
|
|
|
8
32
|
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
const { render, waitFor } = require('@testing-library/react');
|
|
6
|
-
|
|
7
5
|
const decorateStory = (storyFn, decorators) =>
|
|
8
6
|
decorators.reduce(
|
|
9
7
|
(decorated, decorator) =>
|
|
@@ -44,6 +42,10 @@ exports.action = (actionName) => jest.fn();
|
|
|
44
42
|
|
|
45
43
|
// Mocked version of: `import { storiesOf } from '@storybook/react'`
|
|
46
44
|
exports.storiesOf = (groupName) => {
|
|
45
|
+
// eslint-disable-next-line global-require -- importing here allows cleanup to be called and prevent useless require in all tests as decorators/parameters are added in test-setup, before all tests
|
|
46
|
+
const { render, waitFor } = require('@testing-library/react');
|
|
47
|
+
// testing-library registers cleanup via afterEach, which is not available in test-setup, only on test-setup-after-env.
|
|
48
|
+
|
|
47
49
|
const localDecorators = [];
|
|
48
50
|
const localParameters = {};
|
|
49
51
|
|
package/jest-preset.js
CHANGED
|
@@ -8,6 +8,12 @@ const useCraco = fs.existsSync(path.resolve('craco.config.js'));
|
|
|
8
8
|
|
|
9
9
|
module.exports = {
|
|
10
10
|
...baseJestPreset,
|
|
11
|
+
|
|
12
|
+
// default maxWorkers is number of the cores - 1. This can means a lot of threads and memory usage, resulting in slower tests
|
|
13
|
+
// 50% is a good compromise as it still adapt the number of threads based on the number of core available while reducing the memory usage
|
|
14
|
+
// This is still configurable with cli `--max-workers` option.
|
|
15
|
+
maxWorkers: '50%',
|
|
16
|
+
|
|
11
17
|
testMatch: [
|
|
12
18
|
...baseJestPreset.testMatch,
|
|
13
19
|
baseJestPreset.testMatch[0].replace('**/__tests__/**/*.', '**/stories.'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornikar/jest-config-react",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "✅⚛️ jest config for react",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"react-dom": "^16.6.3 || ^17.0.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ornikar/jest-config": "^9.
|
|
26
|
+
"@ornikar/jest-config": "^9.1.0",
|
|
27
27
|
"identity-obj-proxy": "^3.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"react": "17.0.2",
|
|
34
34
|
"react-dom": "17.0.2"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "ff644cdcade29e287265994253b213e4cd32f765"
|
|
37
37
|
}
|