@ornikar/jest-config-react-native 3.3.0-beta.0 → 3.3.2
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 +27 -0
- package/jest-preset.js +3 -0
- package/package.json +5 -4
- package/svg-transformer.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
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
|
+
## [3.3.2](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@3.3.1...@ornikar/jest-config-react-native@3.3.2) (2022-02-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ornikar/jest-config-react-native
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.3.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@3.3.0...@ornikar/jest-config-react-native@3.3.1) (2022-02-01)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @ornikar/jest-config-react-native
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.3.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@3.2.1...@ornikar/jest-config-react-native@3.3.0) (2022-01-31)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **jest-config-react-native:** support svg with svgr named loader CME-229 ([#638](https://github.com/ornikar/shared-configs/issues/638)) ([09c70f7](https://github.com/ornikar/shared-configs/commit/09c70f753217c8dfee467c79c240d36eaa041f28))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [3.2.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@3.2.0...@ornikar/jest-config-react-native@3.2.1) (2022-01-18)
|
|
7
34
|
|
|
8
35
|
|
package/jest-preset.js
CHANGED
|
@@ -22,6 +22,8 @@ module.exports = {
|
|
|
22
22
|
'^@storybook/addon-actions$': require.resolve('./__mocks__/@storybook/addon-actions.js'),
|
|
23
23
|
'@storybook/react-native$': require.resolve('./__mocks__/@storybook/react-native.jsx'),
|
|
24
24
|
'^@storybook/react-native$': require.resolve('./__mocks__/@storybook/react-native.jsx'),
|
|
25
|
+
'@storybook/react$': require.resolve('./__mocks__/@storybook/react-native.jsx'),
|
|
26
|
+
'^@storybook/react$': require.resolve('./__mocks__/@storybook/react-native.jsx'),
|
|
25
27
|
},
|
|
26
28
|
transform: {
|
|
27
29
|
// remove svg asset transformer from expo config, as we configure svg with custom metro transformer
|
|
@@ -31,6 +33,7 @@ module.exports = {
|
|
|
31
33
|
return [key, value];
|
|
32
34
|
}),
|
|
33
35
|
),
|
|
36
|
+
// legacy support, use { ReactComponent } from .svg instead.
|
|
34
37
|
'\\.inline\\.svg$': '@ornikar/jest-config-react-native/svg-transformer-inline',
|
|
35
38
|
'\\.svg$': '@ornikar/jest-config-react-native/svg-transformer',
|
|
36
39
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornikar/jest-config-react-native",
|
|
3
|
-
"version": "3.3.
|
|
4
|
-
"description": "jest config",
|
|
3
|
+
"version": "3.3.2",
|
|
4
|
+
"description": "✅⚛️📱 jest config for react-native",
|
|
5
5
|
"repository": "ornikar/shared-configs",
|
|
6
6
|
"main": "jest-preset.js",
|
|
7
7
|
"license": "ISC",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"react-dom": "^17.0.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@ornikar/jest-config": "^7.1.
|
|
22
|
+
"@ornikar/jest-config": "^7.1.4",
|
|
23
23
|
"jest-svg-transformer": "^1.0.0",
|
|
24
24
|
"lodash.mergewith": "4.6.2"
|
|
25
25
|
},
|
|
@@ -28,5 +28,6 @@
|
|
|
28
28
|
"@testing-library/react-native": "9.0.0",
|
|
29
29
|
"jest-expo": "44.0.1",
|
|
30
30
|
"react": "17.0.2"
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
|
+
"gitHead": "aaa1e18faf8d29706f6272312bce9d7214ab31e8"
|
|
32
33
|
}
|
package/svg-transformer.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const process = require('jest-svg-transformer');
|
|
3
|
+
const { process } = require('jest-svg-transformer');
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
exports.process = (src, filepath) => {
|
|
6
6
|
const content = process(src, filepath);
|
|
7
7
|
return content.replace(
|
|
8
8
|
/module.exports = (.*);/,
|
|
9
9
|
`module.exports = new Proxy({}, {
|
|
10
10
|
get: function getter(target, key) {
|
|
11
11
|
if (key === '__esModule') {
|
|
12
|
-
return
|
|
12
|
+
return true;
|
|
13
13
|
}
|
|
14
14
|
if (key === 'default') {
|
|
15
15
|
return $1.name;
|
|
@@ -17,7 +17,7 @@ module.exports = (src, filepath) => {
|
|
|
17
17
|
if (key === 'ReactComponent') {
|
|
18
18
|
return $1;
|
|
19
19
|
}
|
|
20
|
-
throw new Error('Invalid key for svg-transformer jest mock
|
|
20
|
+
throw new Error('Invalid key for svg-transformer jest mock: ' + key);
|
|
21
21
|
}
|
|
22
22
|
});`,
|
|
23
23
|
);
|