@ornikar/jest-config-react-native 1.0.1 → 1.4.0
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 +45 -0
- package/__mocks__/@storybook/react-native.jsx +6 -5
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,51 @@
|
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **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))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **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))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# [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)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* 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))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# [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)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* **deps:** update dependency @testing-library/react-hooks to v7.0.2 ([#548](https://github.com/ornikar/shared-configs/issues/548)) ([2dfb8c7](https://github.com/ornikar/shared-configs/commit/2dfb8c79b31ad4211cd2a41fc31c432b39b1de3b))
|
|
45
|
+
* **deps:** update dependency @testing-library/react-native to v8 ([#549](https://github.com/ornikar/shared-configs/issues/549)) ([eebf3ef](https://github.com/ornikar/shared-configs/commit/eebf3ef93d92b4729dd2e80358c98ed13d9ee0e8))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
6
51
|
## [1.0.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@1.0.0...@ornikar/jest-config-react-native@1.0.1) (2021-11-18)
|
|
7
52
|
|
|
8
53
|
**Note:** Version bump only for package @ornikar/jest-config-react-native
|
|
@@ -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
|
|
74
|
-
|
|
73
|
+
const rtlApi = render(React.createElement(WrappingComponent, { children: story(context) }));
|
|
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.0
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "jest config",
|
|
5
5
|
"repository": "ornikar/shared-configs",
|
|
6
6
|
"main": "jest-preset.js",
|
|
@@ -13,20 +13,20 @@
|
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"@testing-library/react-hooks": "^7.0.0",
|
|
16
|
-
"@testing-library/react-native": "^7.2.0",
|
|
17
|
-
"jest-expo": "^41.0.0",
|
|
18
|
-
"react": "^
|
|
19
|
-
"react-dom": "^
|
|
16
|
+
"@testing-library/react-native": "^7.2.0 || ^8.0.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",
|
|
23
23
|
"lodash.mergewith": "4.6.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@testing-library/react-hooks": "7.0.
|
|
27
|
-
"@testing-library/react-native": "
|
|
28
|
-
"jest-expo": "
|
|
29
|
-
"react": "
|
|
26
|
+
"@testing-library/react-hooks": "7.0.2",
|
|
27
|
+
"@testing-library/react-native": "8.0.0",
|
|
28
|
+
"jest-expo": "43.0.1",
|
|
29
|
+
"react": "17.0.2"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "e5d754161708fa3d9d478e556f474fd285b0d4a8"
|
|
32
32
|
}
|