@ornikar/jest-config-react 10.2.2 → 10.3.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,25 @@
|
|
|
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
|
+
## [10.3.1](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.3.0...@ornikar/jest-config-react@10.3.1) (2023-02-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ornikar/jest-config-react
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [10.3.0](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.2.2...@ornikar/jest-config-react@10.3.0) (2022-12-16)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **jest-config-react:** add storybook mocks [no issue] ([#827](https://github.com/ornikar/shared-configs/issues/827)) ([3ebed2f](https://github.com/ornikar/shared-configs/commit/3ebed2fac66dc585d36712a668c040db294fb0ff))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [10.2.2](https://github.com/ornikar/shared-configs/compare/@ornikar/jest-config-react@10.2.1...@ornikar/jest-config-react@10.2.2) (2022-11-30)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @ornikar/jest-config-react
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.makeDecorator = ({ name, parameterName, wrapper, skipIfNoParametersOrOptions = false }) => {
|
|
4
|
+
const decorator = (options) => (storyFn, context) => {
|
|
5
|
+
const parameters = context.parameters && context.parameters[parameterName];
|
|
6
|
+
|
|
7
|
+
if (parameters && parameters.disable) {
|
|
8
|
+
return storyFn(context);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (skipIfNoParametersOrOptions && !options && !parameters) {
|
|
12
|
+
return storyFn(context);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return wrapper(storyFn, context, {
|
|
16
|
+
options,
|
|
17
|
+
parameters,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (...args) => {
|
|
22
|
+
if (typeof args[0] === 'function') {
|
|
23
|
+
return decorator()(...args);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (...innerArgs) => {
|
|
27
|
+
if (innerArgs.length > 1) {
|
|
28
|
+
if (args.length > 1) {
|
|
29
|
+
return decorator(args)(...innerArgs);
|
|
30
|
+
}
|
|
31
|
+
return decorator(...args)(...innerArgs);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
throw new Error(
|
|
35
|
+
`Passing stories directly into ${name}() is not allowed,
|
|
36
|
+
instead use addDecorator(${name}) and pass options with the '${parameterName}' parameter`,
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
package/jest-preset.js
CHANGED
|
@@ -40,6 +40,8 @@ module.exports = {
|
|
|
40
40
|
'\\.css$': 'identity-obj-proxy',
|
|
41
41
|
'@storybook/react$': require.resolve('./__mocks__/@storybook/react'),
|
|
42
42
|
'@storybook/react-native$': require.resolve('./__mocks__/@storybook/react'),
|
|
43
|
+
'@storybook/addons': require.resolve('./__mocks__/@storybook/addons'),
|
|
44
|
+
'@storybook/addon-actions': require.resolve('./__mocks__/@storybook/addon-actions'),
|
|
43
45
|
'@storybook/addon-knobs': require.resolve('./__mocks__/@storybook/addon-knobs'),
|
|
44
46
|
'storybook-react-router': require.resolve('./__mocks__/storybook-react-router'),
|
|
45
47
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornikar/jest-config-react",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.1",
|
|
4
4
|
"description": "✅⚛️ jest config for react",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "@ornikar/jest-config-react",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"react-dom": "^16.6.3 || ^17.0.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ornikar/jest-config": "^9.
|
|
26
|
+
"@ornikar/jest-config": "^9.4.0",
|
|
27
27
|
"identity-obj-proxy": "^3.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -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": "
|
|
39
|
+
"gitHead": "c05cb7f11c0884ca81fa35c6654e8fb4e1545ded"
|
|
40
40
|
}
|