@pie-lib/test-utils 0.3.1-beta.0 → 0.5.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.json CHANGED
@@ -1,137 +1 @@
1
- [
2
- {
3
- "type": "fix",
4
- "scope": null,
5
- "subject": "rm child prepack in favour of root prepack",
6
- "merge": null,
7
- "header": "fix: rm child prepack in favour of root prepack",
8
- "body": null,
9
- "footer": null,
10
- "notes": [],
11
- "hash": "381d8d6485269b641d8d4655148966d2e70803be",
12
- "gitTags": "",
13
- "committerDate": "2019-03-15 09:51:11 +0000",
14
- "isTagged": true,
15
- "tag": "@pie-lib/test-utils@0.1.9"
16
- },
17
- {
18
- "type": "chore",
19
- "scope": null,
20
- "subject": "get packages to call changelog function on prepack",
21
- "merge": null,
22
- "header": "chore: get packages to call changelog function on prepack",
23
- "body": null,
24
- "footer": null,
25
- "notes": [],
26
- "hash": "8828f01f2d16d29404ba837c1de40d09e7230ec5",
27
- "gitTags": "",
28
- "committerDate": "2019-03-14 12:40:05 +0000",
29
- "isTagged": true,
30
- "tag": "@pie-lib/test-utils@0.1.5"
31
- },
32
- {
33
- "type": "chore",
34
- "scope": null,
35
- "subject": "call changelog on prepack",
36
- "merge": null,
37
- "header": "chore: call changelog on prepack",
38
- "body": null,
39
- "footer": null,
40
- "notes": [],
41
- "hash": "b672c012de096c55b765a765f758da3fc5df2f90",
42
- "gitTags": "",
43
- "committerDate": "2019-03-13 23:00:44 +0000",
44
- "isTagged": true,
45
- "tag": "@pie-lib/test-utils@0.1.4"
46
- },
47
- {
48
- "type": "chore",
49
- "scope": null,
50
- "subject": "generate changelog.json instead of markdown",
51
- "merge": null,
52
- "header": "chore: generate changelog.json instead of markdown",
53
- "body": null,
54
- "footer": null,
55
- "notes": [],
56
- "hash": "eaa5019a11f70c53425d55856bd3b940237f8c7d",
57
- "gitTags": "",
58
- "committerDate": "2019-03-13 17:24:09 +0000",
59
- "isTagged": true,
60
- "tag": "@pie-lib/test-utils@0.1.2"
61
- },
62
- {
63
- "type": "feat",
64
- "scope": null,
65
- "subject": "libs version bump",
66
- "merge": null,
67
- "header": "feat: libs version bump",
68
- "body": null,
69
- "footer": null,
70
- "notes": [],
71
- "hash": "de9ac2b9f8dbcbf4cdf86826e91c8fff54812f50",
72
- "gitTags": "",
73
- "committerDate": "2019-01-30 22:14:28 +0000",
74
- "isTagged": true,
75
- "tag": "@pie-lib/test-utils@0.1.0"
76
- },
77
- {
78
- "type": "fix",
79
- "scope": "dependencies",
80
- "subject": "make enzyme a peerDependency",
81
- "merge": null,
82
- "header": "fix(dependencies): make enzyme a peerDependency",
83
- "body": null,
84
- "footer": null,
85
- "notes": [],
86
- "hash": "181c641f795fed54c535a69dd35103a994870a4b",
87
- "gitTags": "",
88
- "committerDate": "2018-05-08 13:28:45 -0400",
89
- "isTagged": true,
90
- "tag": "@pie-lib/test-utils@0.0.3"
91
- },
92
- {
93
- "type": "feature",
94
- "scope": "test-utils",
95
- "subject": "added test-utils shallowChild",
96
- "merge": null,
97
- "header": "feature(test-utils): added test-utils shallowChild",
98
- "body": null,
99
- "footer": null,
100
- "notes": [],
101
- "hash": "aa5cd22797c26882f9dfc098601f5ef9bce5cbfd",
102
- "gitTags": "",
103
- "committerDate": "2018-05-02 18:36:56 +0300",
104
- "isTagged": true,
105
- "tag": "@pie-lib/test-utils@0.0.2"
106
- },
107
- {
108
- "type": "feat",
109
- "scope": null,
110
- "subject": "version bumps",
111
- "merge": null,
112
- "header": "feat: version bumps",
113
- "body": null,
114
- "footer": null,
115
- "notes": [],
116
- "hash": "23eb54f95e4b6480e2f8c5b336627a7f3bc2f428",
117
- "gitTags": "",
118
- "committerDate": "2019-06-10 15:24:32 +0100",
119
- "isTagged": true,
120
- "tag": "@pie-lib/test-utils@0.2.0"
121
- },
122
- {
123
- "type": "fix",
124
- "scope": null,
125
- "subject": "add module prop to package.json",
126
- "merge": null,
127
- "header": "fix: add module prop to package.json",
128
- "body": null,
129
- "footer": null,
130
- "notes": [],
131
- "hash": "e0cc5001b9edd219f54356b621db357260f19830",
132
- "gitTags": "",
133
- "committerDate": "2020-03-30 13:03:48 +0100",
134
- "isTagged": true,
135
- "tag": "@pie-lib/test-utils@0.2.3"
136
- }
137
- ]
1
+ []
package/CHANGELOG.md CHANGED
@@ -3,7 +3,151 @@
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
- ## [0.3.1-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.1-beta.0) (2025-07-20)
6
+ # [0.5.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.5.0) (2025-07-31)
7
+
8
+ **Note:** Version bump only for package @pie-lib/test-utils
9
+
10
+
11
+
12
+
13
+
14
+ # [0.4.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.4.0) (2025-07-31)
15
+
16
+ **Note:** Version bump only for package @pie-lib/test-utils
17
+
18
+
19
+
20
+
21
+
22
+ # [0.3.0-beta.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.8) (2025-07-25)
23
+
24
+ **Note:** Version bump only for package @pie-lib/test-utils
25
+
26
+
27
+
28
+
29
+
30
+ # [0.3.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.7) (2025-07-25)
31
+
32
+ **Note:** Version bump only for package @pie-lib/test-utils
33
+
34
+
35
+
36
+
37
+
38
+ # [0.3.0-beta.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.7) (2025-07-25)
39
+
40
+ **Note:** Version bump only for package @pie-lib/test-utils
41
+
42
+
43
+
44
+
45
+
46
+ # [0.3.0-beta.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.6) (2025-07-25)
47
+
48
+ **Note:** Version bump only for package @pie-lib/test-utils
49
+
50
+
51
+
52
+
53
+
54
+ # [0.3.0-beta.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.6) (2025-07-25)
55
+
56
+ **Note:** Version bump only for package @pie-lib/test-utils
57
+
58
+
59
+
60
+
61
+
62
+ # [0.3.0-beta.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.5) (2025-07-25)
63
+
64
+ **Note:** Version bump only for package @pie-lib/test-utils
65
+
66
+
67
+
68
+
69
+
70
+ # [0.3.0-beta.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.5) (2025-07-25)
71
+
72
+ **Note:** Version bump only for package @pie-lib/test-utils
73
+
74
+
75
+
76
+
77
+
78
+ # [0.3.0-beta.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.4) (2025-07-25)
79
+
80
+ **Note:** Version bump only for package @pie-lib/test-utils
81
+
82
+
83
+
84
+
85
+
86
+ # [0.3.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.3) (2025-07-25)
87
+
88
+ **Note:** Version bump only for package @pie-lib/test-utils
89
+
90
+
91
+
92
+
93
+
94
+ # [0.3.0-beta.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.4) (2025-07-23)
95
+
96
+ **Note:** Version bump only for package @pie-lib/test-utils
97
+
98
+
99
+
100
+
101
+
102
+ # [0.3.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.3) (2025-07-23)
103
+
104
+ **Note:** Version bump only for package @pie-lib/test-utils
105
+
106
+
107
+
108
+
109
+
110
+ # [0.3.0-beta.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.3) (2025-07-20)
111
+
112
+ **Note:** Version bump only for package @pie-lib/test-utils
113
+
114
+
115
+
116
+
117
+
118
+ # [0.3.0-beta.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.2) (2025-07-20)
119
+
120
+ **Note:** Version bump only for package @pie-lib/test-utils
121
+
122
+
123
+
124
+
125
+
126
+ # [0.3.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.1) (2025-07-20)
127
+
128
+ **Note:** Version bump only for package @pie-lib/test-utils
129
+
130
+
131
+
132
+
133
+
134
+ # [0.3.0-beta.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.2) (2025-07-20)
135
+
136
+ **Note:** Version bump only for package @pie-lib/test-utils
137
+
138
+
139
+
140
+
141
+
142
+ # [0.3.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.1) (2025-07-20)
143
+
144
+ **Note:** Version bump only for package @pie-lib/test-utils
145
+
146
+
147
+
148
+
149
+
150
+ # [0.3.0-beta.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.1) (2025-07-20)
7
151
 
8
152
  **Note:** Version bump only for package @pie-lib/test-utils
9
153
 
package/lib/index.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.shallowChild = shallowChild;
11
+
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
14
+ var React = _interopRequireWildcard(require("react"));
15
+
16
+ var _enzyme = require("enzyme");
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ function shallowChild(Component) {
23
+ var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24
+ var nestLevel = arguments.length > 2 ? arguments[2] : undefined;
25
+ return function innerRender() {
26
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
27
+ var rendered = (0, _enzyme.shallow)( /*#__PURE__*/React.createElement(Component, (0, _extends2["default"])({}, defaultProps, props)));
28
+
29
+ if (nestLevel) {
30
+ var repeat = nestLevel;
31
+
32
+ while (repeat--) {
33
+ rendered = rendered.first().shallow();
34
+ }
35
+ }
36
+
37
+ return rendered;
38
+ };
39
+ }
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.js"],"names":["shallowChild","Component","defaultProps","nestLevel","innerRender","props","rendered","repeat","first","shallow"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEO,SAASA,YAAT,CAAsBC,SAAtB,EAA+D;AAAA,MAA9BC,YAA8B,uEAAf,EAAe;AAAA,MAAXC,SAAW;AACpE,SAAO,SAASC,WAAT,GAAiC;AAAA,QAAZC,KAAY,uEAAJ,EAAI;AACtC,QAAIC,QAAQ,GAAG,mCAAQ,oBAAC,SAAD,gCAAeJ,YAAf,EAAiCG,KAAjC,EAAR,CAAf;;AAEA,QAAIF,SAAJ,EAAe;AACb,UAAII,MAAM,GAAGJ,SAAb;;AAEA,aAAOI,MAAM,EAAb,EAAiB;AACfD,QAAAA,QAAQ,GAAGA,QAAQ,CAACE,KAAT,GAAiBC,OAAjB,EAAX;AACD;AACF;;AAED,WAAOH,QAAP;AACD,GAZD;AAaD","sourcesContent":["import * as React from 'react';\nimport { shallow } from 'enzyme';\n\nexport function shallowChild(Component, defaultProps = {}, nestLevel) {\n return function innerRender(props = {}) {\n let rendered = shallow(<Component {...defaultProps} {...props} />);\n\n if (nestLevel) {\n let repeat = nestLevel;\n\n while (repeat--) {\n rendered = rendered.first().shallow();\n }\n }\n\n return rendered;\n };\n}\n"],"file":"index.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/test-utils",
3
- "version": "0.3.1-beta.0",
3
+ "version": "0.5.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
@@ -13,6 +13,6 @@
13
13
  "enzyme": "^3.8.0",
14
14
  "react": "^16.8.1"
15
15
  },
16
- "gitHead": "e2aa3ddac60f49bcb8c2562370f496323642f453",
16
+ "gitHead": "ecb1ca31aa1c24d23af00d5ad04ce73ed8871057",
17
17
  "scripts": {}
18
18
  }