@ornikar/jest-config-react 10.4.0-alpha.1 → 10.4.1
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,6 +3,37 @@
|
|
|
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.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
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update jest 29 [no issue] ([#878](https://github.com/ornikar/shared-configs/issues/878)) ([61a0f26](https://github.com/ornikar/shared-configs/commit/61a0f26136d961bdca04b137c44ec756365d9339))
|
|
12
|
+
* 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))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [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)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* update to Jest v29 INS-2202 ([#793](https://github.com/ornikar/shared-configs/issues/793)) ([83cb178](https://github.com/ornikar/shared-configs/commit/83cb1786a3bdfe324135047da48e0c552ec27866))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## [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)
|
|
30
|
+
|
|
31
|
+
**Note:** Version bump only for package @ornikar/jest-config-react
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
6
37
|
# [10.3.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.2.2...@ornikar/jest-config-react@10.3.0) (2022-12-16)
|
|
7
38
|
|
|
8
39
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornikar/jest-config-react",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.1",
|
|
4
4
|
"description": "✅⚛️ jest config for react",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "@ornikar/jest-config-react",
|
|
@@ -18,23 +18,24 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@testing-library/react": "^11.2.5 || ^12.0.0",
|
|
20
20
|
"@testing-library/react-hooks": "^5.1.0 || ^7.0.0",
|
|
21
|
-
"jest": "29.
|
|
22
|
-
"jest-environment-jsdom": "29.
|
|
21
|
+
"jest": "^29.5.0",
|
|
22
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
23
23
|
"react": "^16.6.3 || ^17.0.0",
|
|
24
24
|
"react-dom": "^16.6.3 || ^17.0.0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ornikar/jest-config": "^9.
|
|
27
|
+
"@ornikar/jest-config": "^9.5.1",
|
|
28
28
|
"identity-obj-proxy": "^3.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@testing-library/react": "12.1.5",
|
|
32
32
|
"@testing-library/react-hooks": "7.0.2",
|
|
33
|
-
"jest": "29.
|
|
33
|
+
"jest": "29.5.0",
|
|
34
34
|
"react": "17.0.2",
|
|
35
35
|
"react-dom": "17.0.2"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"lint:eslint": "yarn ../.. eslint --report-unused-disable-directives --quiet @ornikar/jest-config-react"
|
|
39
|
-
}
|
|
39
|
+
},
|
|
40
|
+
"gitHead": "2f95690fc13d3efd668d4e46429ad6a8a753870c"
|
|
40
41
|
}
|
|
@@ -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
|
};
|