@ornikar/jest-config-react 11.0.0-alpha.0 → 11.0.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 CHANGED
@@ -3,12 +3,53 @@
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
- # [11.0.0-alpha.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.3.0...@ornikar/jest-config-react@11.0.0-alpha.0) (2023-02-08)
6
+ ## [11.0.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.4.2...@ornikar/jest-config-react@11.0.0) (2023-05-04)
7
+
8
+
9
+ ### ⚠ BREAKING CHANGES
10
+
11
+ * requires react 18
12
+
13
+ ### Features
14
+
15
+ * migrate to react 18 ECF-193 ([#866](https://github.com/ornikar/shared-configs/issues/866)) ([0d5b3b0](https://github.com/ornikar/shared-configs/commit/0d5b3b0b1cda6a9e4b075bb3c8c3180740b0744d))
16
+
17
+
18
+
19
+ ## [10.4.2](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.4.1...@ornikar/jest-config-react@10.4.2) (2023-04-14)
20
+
21
+ **Note:** Version bump only for package @ornikar/jest-config-react
22
+
23
+
24
+
25
+
26
+
27
+ ## [10.4.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.4.0...@ornikar/jest-config-react@10.4.1) (2023-03-23)
7
28
 
8
29
 
9
30
  ### Bug Fixes
10
31
 
11
- * svg transformer inline ([11fe9de](https://github.com/ornikar/shared-configs/commit/11fe9deb3047460569fad0e8d9fd86647f5907d0))
32
+ * update jest 29 [no issue] ([#878](https://github.com/ornikar/shared-configs/issues/878)) ([61a0f26](https://github.com/ornikar/shared-configs/commit/61a0f26136d961bdca04b137c44ec756365d9339))
33
+ * update transformers for jest 29 [no issue] ([#877](https://github.com/ornikar/shared-configs/issues/877)) ([4171446](https://github.com/ornikar/shared-configs/commit/417144649d16d67d783cb6f5ed172785064f5a3e))
34
+
35
+
36
+
37
+
38
+
39
+ # [10.4.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.3.1...@ornikar/jest-config-react@10.4.0) (2023-02-09)
40
+
41
+
42
+ ### Features
43
+
44
+ * update to Jest v29 INS-2202 ([#793](https://github.com/ornikar/shared-configs/issues/793)) ([83cb178](https://github.com/ornikar/shared-configs/commit/83cb1786a3bdfe324135047da48e0c552ec27866))
45
+
46
+
47
+
48
+
49
+
50
+ ## [10.3.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.3.0...@ornikar/jest-config-react@10.3.1) (2023-02-03)
51
+
52
+ **Note:** Version bump only for package @ornikar/jest-config-react
12
53
 
13
54
 
14
55
 
@@ -3,6 +3,7 @@
3
3
  'use strict';
4
4
 
5
5
  const decorateStory = (storyFn, decorators) =>
6
+ // eslint-disable-next-line unicorn/no-array-reduce
6
7
  decorators.reduce(
7
8
  (decorated, decorator) =>
8
9
  (context = {}) =>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornikar/jest-config-react",
3
- "version": "11.0.0-alpha.0",
3
+ "version": "11.0.0",
4
4
  "description": "✅⚛️ jest config for react",
5
5
  "repository": {
6
6
  "directory": "@ornikar/jest-config-react",
@@ -16,26 +16,24 @@
16
16
  "access": "public"
17
17
  },
18
18
  "peerDependencies": {
19
- "@testing-library/react": "^11.2.5 || ^12.0.0",
20
- "@testing-library/react-hooks": "^5.1.0 || ^7.0.0",
21
- "jest": "29.4.1",
22
- "jest-environment-jsdom": "29.4.1",
23
- "react": "^16.6.3 || ^17.0.0",
24
- "react-dom": "^16.6.3 || ^17.0.0"
19
+ "@testing-library/react": "^14.0.0",
20
+ "jest": "^29.5.0",
21
+ "jest-environment-jsdom": "^29.5.0",
22
+ "react": "^18.2.0",
23
+ "react-dom": "^18.2.0"
25
24
  },
26
25
  "dependencies": {
27
- "@ornikar/jest-config": "^10.0.0-alpha.0",
26
+ "@ornikar/jest-config": "^9.5.1",
28
27
  "identity-obj-proxy": "^3.0.0"
29
28
  },
30
29
  "devDependencies": {
31
- "@testing-library/react": "12.1.5",
32
- "@testing-library/react-hooks": "7.0.2",
33
- "jest": "29.4.1",
34
- "react": "17.0.2",
35
- "react-dom": "17.0.2"
30
+ "@testing-library/react": "14.0.0",
31
+ "jest": "29.5.0",
32
+ "react": "18.2.0",
33
+ "react-dom": "18.2.0"
36
34
  },
37
35
  "scripts": {
38
36
  "lint:eslint": "yarn ../.. eslint --report-unused-disable-directives --quiet @ornikar/jest-config-react"
39
37
  },
40
- "gitHead": "3c32ef2496e9ab2b50b3bd0c8b1e3c45a1369421"
38
+ "gitHead": "834ccb001ff6b9bf956d94b17c29b3defbe7d319"
41
39
  }
@@ -5,6 +5,6 @@ const path = require('path');
5
5
  module.exports = {
6
6
  process(src, filePath) {
7
7
  const assetFilename = JSON.stringify(path.basename(filePath));
8
- return `module.exports = ${assetFilename};`;
8
+ return { code: `module.exports = ${assetFilename};` };
9
9
  },
10
10
  };
@@ -5,15 +5,13 @@ const path = require('path');
5
5
  exports.process = function process(src, filePath) {
6
6
  const assetFilename = JSON.stringify(path.basename(filePath));
7
7
  return {
8
- code: `
9
- const { jsx } = require('react/jsx-runtime');
10
- function JestSvgComponent(props) {
11
- return jsx(
12
- 'svg',
13
- Object.assign({}, props, {'data-file-name': ${assetFilename}})
14
- );
15
- }
16
- module.exports = JestSvgComponent;
17
- `,
8
+ code: `const { jsx } = require('react/jsx-runtime');
9
+ function JestSvgComponent(props) {
10
+ return jsx(
11
+ 'svg',
12
+ Object.assign({}, props, {'data-file-name': ${assetFilename}})
13
+ );
14
+ }
15
+ module.exports = JestSvgComponent;`,
18
16
  };
19
17
  };
@@ -5,22 +5,24 @@ const { process } = require('./svg-transformer-inline');
5
5
 
6
6
  exports.process = (src, filePath) => {
7
7
  const assetFilename = JSON.stringify(path.basename(filePath));
8
- const content = process(src, filePath);
9
- return content.replace(
10
- /module.exports = (.*);/,
11
- `module.exports = new Proxy({}, {
12
- get: function getter(target, key) {
13
- if (key === '__esModule') {
14
- return true;
15
- }
16
- if (key === 'default') {
17
- return ${assetFilename};
18
- }
19
- if (key === 'ReactComponent') {
20
- return $1;
21
- }
22
- throw new Error('Invalid key for svg-transformer jest mock: ' + key);
8
+ const { code } = process(src, filePath);
9
+ return {
10
+ code: code.replace(
11
+ /module.exports = (.*);/,
12
+ `module.exports = new Proxy({}, {
13
+ get: function getter(target, key) {
14
+ if (key === '__esModule') {
15
+ return true;
23
16
  }
24
- });`,
25
- );
17
+ if (key === 'default') {
18
+ return ${assetFilename};
19
+ }
20
+ if (key === 'ReactComponent') {
21
+ return $1;
22
+ }
23
+ throw new Error('Invalid key for svg-transformer jest mock: ' + key);
24
+ }
25
+ });`,
26
+ ),
27
+ };
26
28
  };
@@ -1,3 +0,0 @@
1
- {
2
- "eslint.workingDirectories": ["../../"]
3
- }