@ornikar/jest-config-react 11.1.1 → 11.3.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,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.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
+
8
+
9
+ ### Features
10
+
11
+ * silence warnings linked to react-native-web 19 INS-2508 ([#958](https://github.com/ornikar/shared-configs/issues/958)) ([4c3356a](https://github.com/ornikar/shared-configs/commit/4c3356a254ed9be32d27c894274e9560caf87040))
12
+
13
+
14
+
15
+ ## [11.2.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@11.1.1...@ornikar/jest-config-react@11.2.0) (2023-08-01)
16
+
17
+
18
+ ### Features
19
+
20
+ * add jest-fail-on-console setup on jest-config-react [no issue] ([#947](https://github.com/ornikar/shared-configs/issues/947)) ([1072200](https://github.com/ornikar/shared-configs/commit/1072200e2eb87d37796795582ee4e3f97eaa5e22))
21
+
22
+
23
+
6
24
  ## [11.1.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@11.1.0...@ornikar/jest-config-react@11.1.1) (2023-07-26)
7
25
 
8
26
  **Note:** Version bump only for package @ornikar/jest-config-react
package/jest-preset.js CHANGED
@@ -24,6 +24,10 @@ module.exports = {
24
24
  require.resolve('./test-setup'),
25
25
  baseJestPreset.setupFiles.at(-1),
26
26
  ],
27
+ setupFilesAfterEnv: [
28
+ // overrides test-setup-after-env from base config.
29
+ require.resolve('./test-setup-after-env'),
30
+ ],
27
31
  transform: {
28
32
  '\\.raw\\.svg$': require.resolve('./transformers/asset-name-transformer'),
29
33
  // legacy support, use { ReactComponent } from .svg instead.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornikar/jest-config-react",
3
- "version": "11.1.1",
3
+ "version": "11.3.0",
4
4
  "description": "✅⚛️ jest config for react",
5
5
  "repository": {
6
6
  "directory": "@ornikar/jest-config-react",
@@ -23,8 +23,9 @@
23
23
  "react-dom": "^18.2.0"
24
24
  },
25
25
  "dependencies": {
26
- "@ornikar/jest-config": "9.5.3",
27
- "identity-obj-proxy": "^3.0.0"
26
+ "@ornikar/jest-config": "9.6.0",
27
+ "identity-obj-proxy": "^3.0.0",
28
+ "jest-fail-on-console": "^3.1.1"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@testing-library/react": "14.0.0",
@@ -35,5 +36,5 @@
35
36
  "scripts": {
36
37
  "lint:eslint": "yarn ../.. eslint --report-unused-disable-directives --quiet @ornikar/jest-config-react"
37
38
  },
38
- "gitHead": "401ca87ce48bab6decda1f16d00438c6b8e264f8"
39
+ "gitHead": "253599eb1d3ac2a7f3a05eb002281d82c207a3a2"
39
40
  }
@@ -0,0 +1,46 @@
1
+ /* eslint-env jest */
2
+
3
+ 'use strict';
4
+
5
+ const failOnConsole = require('jest-fail-on-console');
6
+
7
+ const deprecatedReactLifeCycleMethods = [
8
+ 'componentWillMount',
9
+ 'componentWillUnmount',
10
+ 'componentWillUpdate',
11
+ 'componentWillReceiveProps',
12
+ ];
13
+
14
+ failOnConsole({
15
+ silenceMessage: (message) => {
16
+ // setNativeProps is used by @react-spring, so we can't do anything about it
17
+ if (message.includes('setNativeProps is deprecated. Please update props using React state instead.')) {
18
+ return true;
19
+ }
20
+
21
+ // Do not ignore the act / await warning anymore once we are on React 18
22
+ if (message.includes('You called act(async () => ...) without await')) return true;
23
+
24
+ // Warning from @react-aria/ssr
25
+ if (message.startsWith('In React 18, SSRProvider is not necessary')) return true;
26
+
27
+ // Deprecated lifecycle methods are forbidden in our eslint config. This means any related warning is due to a dependency and can be ignored in tests.
28
+ if (
29
+ deprecatedReactLifeCycleMethods.some((lifecycleMethod) =>
30
+ message.includes(`${lifecycleMethod} has been renamed, and is not recommended for use.`),
31
+ )
32
+ ) {
33
+ return true;
34
+ }
35
+
36
+ // Native base is setting these props, which are deprecated by react-native-web
37
+ if (message.startsWith('"shadow*" style props are deprecated. Use "boxShadow"')) return true;
38
+ if (message.startsWith('accessibilityLabel is deprecated. Use aria-label.')) return true;
39
+ if (message.startsWith('editable is deprecated. Use readOnly.')) return true;
40
+ if (message.startsWith('props.pointerEvents is deprecated. Use style.pointerEvents')) return true;
41
+ // Native base does not support role prop and needs accessibilityRole which is deprecated by react-native-web
42
+ if (message.startsWith('accessibilityRole is deprecated. Use role.')) return true;
43
+
44
+ return false;
45
+ },
46
+ });