@ornikar/jest-config-react-native 1.1.0 → 1.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,50 @@
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
+ ## [1.4.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@1.4.0...@ornikar/jest-config-react-native@1.4.1) (2021-12-06)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **jest-config-react-native:** use wrapper option in storybook mock [no issue] ([#582](https://github.com/ornikar/shared-configs/issues/582)) ([234fdbb](https://github.com/ornikar/shared-configs/commit/234fdbb301c5e8f56ea2ef9e27623b004d2a9ae0))
12
+
13
+
14
+
15
+
16
+
17
+ # [1.4.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@1.3.0...@ornikar/jest-config-react-native@1.4.0) (2021-12-02)
18
+
19
+
20
+ ### Features
21
+
22
+ * **deps:** update react monorepo to v17 (major) ([#571](https://github.com/ornikar/shared-configs/issues/571)) ([b0aa0b8](https://github.com/ornikar/shared-configs/commit/b0aa0b8138978d6722c8a5ff5374d200f4cdd099))
23
+
24
+
25
+
26
+
27
+
28
+ # [1.3.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@1.2.0...@ornikar/jest-config-react-native@1.3.0) (2021-12-02)
29
+
30
+
31
+ ### Features
32
+
33
+ * **deps:** update dependency jest-expo to v43 ([#565](https://github.com/ornikar/shared-configs/issues/565)) ([09ba17e](https://github.com/ornikar/shared-configs/commit/09ba17eca1dfecda271d772e0d3d938e080fe0c1))
34
+
35
+
36
+
37
+
38
+
39
+ # [1.2.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@1.1.0...@ornikar/jest-config-react-native@1.2.0) (2021-11-29)
40
+
41
+
42
+ ### Features
43
+
44
+ * add waitFor in stories mock [no issue] ([#550](https://github.com/ornikar/shared-configs/issues/550)) ([9a4f254](https://github.com/ornikar/shared-configs/commit/9a4f25431cf556099b6c48dd52670937526c19b7))
45
+
46
+
47
+
48
+
49
+
6
50
  # [1.1.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@1.0.1...@ornikar/jest-config-react-native@1.1.0) (2021-11-29)
7
51
 
8
52
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  'use strict';
4
4
 
5
- const { render } = require('@testing-library/react-native');
5
+ const { render, waitFor } = require('@testing-library/react-native');
6
6
  const React = require('react');
7
7
 
8
8
  const decorateStory = (storyFn, decorators) =>
@@ -51,7 +51,7 @@ exports.storiesOf = (groupName) => {
51
51
  const parameters = { ...localParameters, ...storyParameters };
52
52
  const context = { name: storyName, parameters };
53
53
  const { jest } = parameters;
54
- const { ignore, ignoreDecorators, createBeforeAfterEachCallbacks } = jest || {};
54
+ const { ignore, ignoreDecorators, createBeforeAfterEachCallbacks, waitFor: waitForExpectation } = jest || {};
55
55
 
56
56
  if (ignore) {
57
57
  test.skip(storyName, () => {});
@@ -65,13 +65,14 @@ exports.storiesOf = (groupName) => {
65
65
  if (after) afterEach(after);
66
66
  }
67
67
 
68
- it(storyName, () => {
68
+ it(storyName, async () => {
69
69
  const WrappingComponent = ignoreDecorators
70
70
  ? undefined
71
71
  : ({ children }) => decorateStory(() => children, [...localDecorators, ...globalDecorators])(context);
72
72
 
73
- const component = render(React.createElement(WrappingComponent, { children: story(context) }));
74
- expect(component.toJSON()).toMatchSnapshot();
73
+ const rtlApi = render(story(context), { wrapper: WrappingComponent });
74
+ if (waitForExpectation) await waitFor(() => waitForExpectation(rtlApi, expect));
75
+ expect(rtlApi.toJSON()).toMatchSnapshot();
75
76
  });
76
77
  });
77
78
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornikar/jest-config-react-native",
3
- "version": "1.1.0",
3
+ "version": "1.4.1",
4
4
  "description": "jest config",
5
5
  "repository": "ornikar/shared-configs",
6
6
  "main": "jest-preset.js",
@@ -14,9 +14,9 @@
14
14
  "peerDependencies": {
15
15
  "@testing-library/react-hooks": "^7.0.0",
16
16
  "@testing-library/react-native": "^7.2.0 || ^8.0.0",
17
- "jest-expo": "^41.0.0",
18
- "react": "^16.13.0",
19
- "react-dom": "^16.13.0"
17
+ "jest-expo": "^41.0.0 || ^42.0.0 || ^43.0.0",
18
+ "react": "^17.0.0",
19
+ "react-dom": "^17.0.0"
20
20
  },
21
21
  "dependencies": {
22
22
  "@ornikar/jest-config": "^6.0.0",
@@ -25,8 +25,8 @@
25
25
  "devDependencies": {
26
26
  "@testing-library/react-hooks": "7.0.2",
27
27
  "@testing-library/react-native": "8.0.0",
28
- "jest-expo": "41.0.0",
29
- "react": "16.13.1"
28
+ "jest-expo": "43.0.1",
29
+ "react": "17.0.2"
30
30
  },
31
- "gitHead": "ac346b8a30d6be08957f38155a238cd1a50b8144"
31
+ "gitHead": "0561e42d60b459b342906da91942a9a3f0e4c052"
32
32
  }