@ornikar/jest-config-react 11.0.0-alpha2.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,14 +3,45 @@
|
|
|
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
|
-
|
|
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
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
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))
|
|
14
45
|
|
|
15
46
|
|
|
16
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornikar/jest-config-react",
|
|
3
|
-
"version": "11.0.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": "^
|
|
20
|
-
"
|
|
21
|
-
"jest": "29.
|
|
22
|
-
"
|
|
23
|
-
"react": "^
|
|
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": "^
|
|
26
|
+
"@ornikar/jest-config": "^9.5.1",
|
|
28
27
|
"identity-obj-proxy": "^3.0.0"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
|
-
"@testing-library/react": "
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"react": "
|
|
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": "
|
|
38
|
+
"gitHead": "834ccb001ff6b9bf956d94b17c29b3defbe7d319"
|
|
41
39
|
}
|
|
@@ -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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
};
|
package/.vscode/settings.json
DELETED