@ornikar/jest-config-react-native 3.4.0 → 4.0.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 CHANGED
@@ -3,6 +3,44 @@
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
+ ## [4.0.2](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@4.0.1...@ornikar/jest-config-react-native@4.0.2) (2022-03-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **jest-config-react-native:** fix platform in directory for jest cleanup system ([9d47c6f](https://github.com/ornikar/shared-configs/commit/9d47c6ff3fb089186c3553bdb08c2f0d2a8ffac6))
12
+
13
+
14
+
15
+
16
+
17
+ ## [4.0.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@4.0.0...@ornikar/jest-config-react-native@4.0.1) (2022-03-09)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **jest-config-react-native:** fix dot missing in resolver ([878c2ab](https://github.com/ornikar/shared-configs/commit/878c2ab47340945ad780122de9b631c7c6d9a98d))
23
+
24
+
25
+
26
+
27
+
28
+ # [4.0.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@3.4.0...@ornikar/jest-config-react-native@4.0.0) (2022-03-09)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **jest-config-react-native:** custom platform resolvers ([23f4f0f](https://github.com/ornikar/shared-configs/commit/23f4f0f1c706a417c7773f96b486012b3676c8d8))
34
+
35
+
36
+ ### BREAKING CHANGES
37
+
38
+ * **jest-config-react-native:** removed nativeSnapshotResolver.js
39
+
40
+
41
+
42
+
43
+
6
44
  # [3.4.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@3.3.2...@ornikar/jest-config-react-native@3.4.0) (2022-03-08)
7
45
 
8
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornikar/jest-config-react-native",
3
- "version": "3.4.0",
3
+ "version": "4.0.2",
4
4
  "description": "✅⚛️📱 jest config for react-native",
5
5
  "repository": "ornikar/shared-configs",
6
6
  "main": "jest-preset.js",
@@ -28,5 +28,5 @@
28
28
  "jest-expo": "44.0.1",
29
29
  "react": "17.0.2"
30
30
  },
31
- "gitHead": "d436e7c9e103d89eba6c89c881659f501f9b08be"
31
+ "gitHead": "b982c148ad8daeaa3626ed561a4f1153f1e8975f"
32
32
  }
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+
5
+ module.exports = function createCustomPlatformResolver(platform) {
6
+ return {
7
+ resolveSnapshotPath: (testPath, snapshotExtension) =>
8
+ path.join(
9
+ path.join(path.dirname(testPath), `__snapshots_${platform}__`),
10
+ path.basename(testPath) + snapshotExtension,
11
+ ),
12
+
13
+ resolveTestPath: (snapshotPath, snapshotExtension) =>
14
+ path.normalize(path.join(path.dirname(snapshotPath), '..', path.basename(snapshotPath, snapshotExtension))),
15
+
16
+ testPathForConsistencyCheck: path.posix.join('consistency_check', 'example.test.js'),
17
+ };
18
+ };
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const createCustomPlatformResolver = require('./createCustomPlatformResolver');
4
+
5
+ module.exports = createCustomPlatformResolver('android');
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const createCustomPlatformResolver = require('./createCustomPlatformResolver');
4
+
5
+ module.exports = createCustomPlatformResolver('ios');
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const createCustomPlatformResolver = require('./createCustomPlatformResolver');
4
+
5
+ module.exports = createCustomPlatformResolver('node');
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const createCustomPlatformResolver = require('./createCustomPlatformResolver');
4
+
5
+ module.exports = createCustomPlatformResolver('web');
@@ -6,6 +6,7 @@ const expoPreset = require('jest-expo/web/jest-preset');
6
6
  module.exports = {
7
7
  ...baseOrnikarPreset,
8
8
  ...expoPreset,
9
+ snapshotResolver: require.resolve('../snapshot-resolvers/resolver.web.js'),
9
10
  setupFiles: [...expoPreset.setupFiles, ...baseOrnikarPreset.setupFiles],
10
11
  testMatch: [
11
12
  ...baseOrnikarPreset.testMatch,
@@ -1,15 +0,0 @@
1
- 'use strict';
2
-
3
- const path = require('path');
4
-
5
- module.exports = {
6
- resolveSnapshotPath: (testPath, snapshotExtension) => {
7
- return `${path.dirname(testPath)}/__native_snapshots__/${path.basename(testPath)}${snapshotExtension}`;
8
- },
9
-
10
- resolveTestPath: (snapshotFilePath, snapshotExtension) => {
11
- return snapshotFilePath.replace('/__native_snapshots__', '').slice(0, -snapshotExtension.length);
12
- },
13
-
14
- testPathForConsistencyCheck: 'src/shared/components/Button/Button.test.tsx',
15
- };