@ornikar/jest-config-react 11.3.0 → 11.3.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,24 @@
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
+ ## [11.3.2](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@11.3.1...@ornikar/jest-config-react@11.3.2) (2023-09-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * fix unmount on stories tests [no issue] ([#971](https://github.com/ornikar/shared-configs/issues/971)) ([1180622](https://github.com/ornikar/shared-configs/commit/11806225cd18926ca4c59cb7a5ba0ebfcd789ba4))
12
+
13
+
14
+
15
+ ## [11.3.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@11.3.0...@ornikar/jest-config-react@11.3.1) (2023-09-14)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * storybook mocks should be in testSetupAfterEnv to make sure testing-library is cleanup properly [no issue] ([#969](https://github.com/ornikar/shared-configs/issues/969)) ([10ed164](https://github.com/ornikar/shared-configs/commit/10ed164f69c3003e9ee87c8b1c2cdfeb154a7ffe))
21
+
22
+
23
+
6
24
  ## [11.3.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@11.2.0...@ornikar/jest-config-react@11.3.0) (2023-08-28)
7
25
 
8
26
 
@@ -2,6 +2,12 @@
2
2
 
3
3
  'use strict';
4
4
 
5
+ if (!global.afterAll) {
6
+ throw new Error(
7
+ 'Missing afterAll global in mock @storybook/react. Please check your jest test-setup and make sure you use testSetupAfterEnv.',
8
+ );
9
+ }
10
+
5
11
  const decorateStory = (storyFn, decorators) =>
6
12
  // eslint-disable-next-line unicorn/no-array-reduce
7
13
  decorators.reduce(
@@ -76,12 +82,11 @@ exports.storiesOf = (groupName) => {
76
82
  : ({ children }) => decorateStory(() => children, [...localDecorators, ...globalDecorators])(context);
77
83
 
78
84
  const rtlApi = render(story(context), { wrapper: wrappingComponent });
79
- const { unmount, asFragment } = rtlApi;
80
85
  if (waitForExpectation) {
81
86
  await waitFor(() => waitForExpectation(rtlApi, expect, { parameters }));
82
87
  }
83
- expect(asFragment()).toMatchSnapshot();
84
- unmount();
88
+ expect(rtlApi.asFragment()).toMatchSnapshot();
89
+ rtlApi.unmount();
85
90
  });
86
91
  });
87
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornikar/jest-config-react",
3
- "version": "11.3.0",
3
+ "version": "11.3.2",
4
4
  "description": "✅⚛️ jest config for react",
5
5
  "repository": {
6
6
  "directory": "@ornikar/jest-config-react",
@@ -36,5 +36,5 @@
36
36
  "scripts": {
37
37
  "lint:eslint": "yarn ../.. eslint --report-unused-disable-directives --quiet @ornikar/jest-config-react"
38
38
  },
39
- "gitHead": "253599eb1d3ac2a7f3a05eb002281d82c207a3a2"
39
+ "gitHead": "1e8017312597411925304b39c90c364119f44ed4"
40
40
  }