@ornikar/jest-config-react-native 2.0.0 → 3.0.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 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
+ # [3.0.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@2.1.0...@ornikar/jest-config-react-native@3.0.0) (2021-12-15)
7
+
8
+
9
+ ### Features
10
+
11
+ * **jest-config-react:** remove random wait, add global addParameters [no issue] ([#601](https://github.com/ornikar/shared-configs/issues/601)) ([764ef11](https://github.com/ornikar/shared-configs/commit/764ef11d9bd29e309438040e06fbdf4f9f6a2e9e))
12
+
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * **jest-config-react:** wait(0) is removed, if you need to wait add waitFor: () => wait(0)
17
+
18
+
19
+
20
+
21
+
22
+ # [2.1.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@2.0.1...@ornikar/jest-config-react-native@2.1.0) (2021-12-14)
23
+
24
+
25
+ ### Features
26
+
27
+ * **deps:** update dependency @testing-library/react-native to v9 ([#599](https://github.com/ornikar/shared-configs/issues/599)) ([97e7278](https://github.com/ornikar/shared-configs/commit/97e72787fc6301146523b9a373ed8cfedcfc40ad))
28
+
29
+
30
+
31
+
32
+
33
+ ## [2.0.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@2.0.0...@ornikar/jest-config-react-native@2.0.1) (2021-12-09)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * downgrade node minimum required version [no issue] ([#595](https://github.com/ornikar/shared-configs/issues/595)) ([9464687](https://github.com/ornikar/shared-configs/commit/9464687f55aed4a2e683f5d3b992300d000a2b30))
39
+
40
+
41
+
42
+
43
+
6
44
  # [2.0.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react-native@1.4.1...@ornikar/jest-config-react-native@2.0.0) (2021-12-07)
7
45
 
8
46
 
@@ -31,12 +31,18 @@ const decorateStory = (storyFn, decorators) =>
31
31
  exports.decorateStory = decorateStory;
32
32
 
33
33
  const globalDecorators = [];
34
+ const globalParameters = {};
34
35
 
35
36
  // Mocked version of `import { addDecorator } from '@storybook/react-native'`.
36
37
  exports.addDecorator = (decorator) => {
37
38
  globalDecorators.push(decorator);
38
39
  };
39
40
 
41
+ // Mocked version of `import { addParameters } from '@storybook/react-native'`.
42
+ exports.addParameters = (parameters) => {
43
+ Object.assign(globalParameters, parameters);
44
+ };
45
+
40
46
  // Mocked version of `import { action } from '@storybook/react-native'`.
41
47
  exports.action = (actionName) => jest.fn();
42
48
 
@@ -48,7 +54,7 @@ exports.storiesOf = (groupName) => {
48
54
  // Mocked API to generate tests from & snapshot stories.
49
55
  const api = {
50
56
  add(storyName, story, storyParameters = {}) {
51
- const parameters = { ...localParameters, ...storyParameters };
57
+ const parameters = { ...globalParameters, ...localParameters, ...storyParameters };
52
58
  const context = { name: storyName, parameters };
53
59
  const { jest } = parameters;
54
60
  const { ignore, ignoreDecorators, createBeforeAfterEachCallbacks, waitFor: waitForExpectation } = jest || {};
@@ -71,7 +77,7 @@ exports.storiesOf = (groupName) => {
71
77
  : ({ children }) => decorateStory(() => children, [...localDecorators, ...globalDecorators])(context);
72
78
 
73
79
  const rtlApi = render(story(context), { wrapper: WrappingComponent });
74
- if (waitForExpectation) await waitFor(() => waitForExpectation(rtlApi, expect));
80
+ if (waitForExpectation) await waitFor(() => waitForExpectation(rtlApi, expect, { parameters }));
75
81
  expect(rtlApi.toJSON()).toMatchSnapshot();
76
82
  });
77
83
  });
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "name": "@ornikar/jest-config-react-native",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "jest config",
5
5
  "repository": "ornikar/shared-configs",
6
6
  "main": "jest-preset.js",
7
7
  "license": "ISC",
8
8
  "engines": {
9
- "node": ">=14.17.6"
9
+ "node": ">=14.17.5"
10
10
  },
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
14
14
  "peerDependencies": {
15
15
  "@testing-library/react-hooks": "^7.0.0",
16
- "@testing-library/react-native": "^7.2.0 || ^8.0.0",
16
+ "@testing-library/react-native": "^7.2.0 || ^8.0.0 || ^9.0.0",
17
17
  "jest-expo": "^41.0.0 || ^42.0.0 || ^43.0.0",
18
18
  "react": "^17.0.0",
19
19
  "react-dom": "^17.0.0"
20
20
  },
21
21
  "dependencies": {
22
- "@ornikar/jest-config": "^7.0.0",
22
+ "@ornikar/jest-config": "^7.0.1",
23
23
  "lodash.mergewith": "4.6.2"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@testing-library/react-hooks": "7.0.2",
27
- "@testing-library/react-native": "8.0.0",
27
+ "@testing-library/react-native": "9.0.0",
28
28
  "jest-expo": "43.0.1",
29
29
  "react": "17.0.2"
30
30
  },
31
- "gitHead": "2e424ab4fb1742312586f4c975c937f74109352e"
31
+ "gitHead": "20a12e9576fd2608d0ce3a7c83012caae48124f7"
32
32
  }