@ornikar/jest-config-react-native 3.1.3 → 3.2.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 +30 -0
- package/jest-preset.js +19 -12
- package/nativeSnapshotResolver.js +19 -0
- package/package.json +4 -3
- package/svg-transformer.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
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.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
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **jest-config-react-native:** fix typo [no issue] ([#631](https://github.com/ornikar/shared-configs/issues/631)) ([41905a1](https://github.com/ornikar/shared-configs/commit/41905a1a940f31aaa700c8a7c8ddc86c1dd3ec66))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.2.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@3.1.4...@ornikar/jest-config-react-native@3.2.0) (2022-01-18)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* jest-config native and web improvements [no issue] ([#630](https://github.com/ornikar/shared-configs/issues/630)) ([0e00bf2](https://github.com/ornikar/shared-configs/commit/0e00bf2ac1fa6d40e9d4063a3c94c18385060dcd))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [3.1.4](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@3.1.3...@ornikar/jest-config-react-native@3.1.4) (2022-01-17)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package @ornikar/jest-config-react-native
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## [3.1.3](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@3.1.2...@ornikar/jest-config-react-native@3.1.3) (2022-01-07)
|
|
7
37
|
|
|
8
38
|
**Note:** Version bump only for package @ornikar/jest-config-react-native
|
package/jest-preset.js
CHANGED
|
@@ -14,16 +14,23 @@ function customizer(objValue, srcValue) {
|
|
|
14
14
|
|
|
15
15
|
const basePreset = mergeWith(expoPreset, jestPreset, customizer);
|
|
16
16
|
|
|
17
|
-
module.exports =
|
|
18
|
-
basePreset,
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
moduleNameMapper
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'^@storybook/react-native$': require.resolve('./__mocks__/@storybook/react-native.jsx'),
|
|
26
|
-
},
|
|
17
|
+
module.exports = {
|
|
18
|
+
...basePreset,
|
|
19
|
+
testMatch: [...basePreset.testMatch, '<rootDir>/src/**/stories.{ts,tsx}', '<rootDir>/src/**/*.stories.{ts,tsx}'],
|
|
20
|
+
moduleNameMapper: {
|
|
21
|
+
...basePreset.moduleNameMapper,
|
|
22
|
+
'^@storybook/addon-actions$': require.resolve('./__mocks__/@storybook/addon-actions.js'),
|
|
23
|
+
'@storybook/react-native$': require.resolve('./__mocks__/@storybook/react-native.jsx'),
|
|
24
|
+
'^@storybook/react-native$': require.resolve('./__mocks__/@storybook/react-native.jsx'),
|
|
27
25
|
},
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
transform: {
|
|
27
|
+
// remove svg asset transformer from expo config, as we configure svg with custom metro transformer
|
|
28
|
+
...Object.fromEntries(
|
|
29
|
+
Object.entries(basePreset.transform).map(([key, value]) => {
|
|
30
|
+
if (key.includes('|svg|')) return [key.replace('|svg|', '|'), value];
|
|
31
|
+
return [key, value];
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
'\\.svg$': '@ornikar/jest-config-react-native/svg-transformer',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
resolveSnapshotPath: (testPath, snapshotExtension) => {
|
|
7
|
+
const snapshotPath = `${path.dirname(testPath)}/__native_snapshots__/${path.basename(
|
|
8
|
+
testPath,
|
|
9
|
+
)}${snapshotExtension}`;
|
|
10
|
+
return snapshotPath;
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
resolveTestPath: (snapshotFilePath, snapshotExtension) => {
|
|
14
|
+
const testPath = snapshotFilePath.replace('/__native_snapshots__', '').slice(0, -snapshotExtension.length);
|
|
15
|
+
return testPath;
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
testPathForConsistencyCheck: 'src/shared/components/Button/Button.test.tsx',
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornikar/jest-config-react-native",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "jest config",
|
|
5
5
|
"repository": "ornikar/shared-configs",
|
|
6
6
|
"main": "jest-preset.js",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"react-dom": "^17.0.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@ornikar/jest-config": "^7.1.
|
|
22
|
+
"@ornikar/jest-config": "^7.1.3",
|
|
23
|
+
"jest-svg-transformer": "^1.0.0",
|
|
23
24
|
"lodash.mergewith": "4.6.2"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
@@ -28,5 +29,5 @@
|
|
|
28
29
|
"jest-expo": "44.0.1",
|
|
29
30
|
"react": "17.0.2"
|
|
30
31
|
},
|
|
31
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "6ff0a682835b819ba2c58f3d38319452e1282793"
|
|
32
33
|
}
|