@pie-lib/test-utils 0.4.0-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 +1 -137
- package/CHANGELOG.md +127 -11
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -0
- package/package.json +2 -2
- package/lib/__tests__/index.test.js +0 -100
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,7 @@
|
|
|
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.
|
|
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
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
# [0.
|
|
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
15
|
|
|
16
16
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
|
|
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
23
|
|
|
24
24
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
|
|
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
31
|
|
|
32
32
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
33
33
|
|
|
@@ -35,7 +35,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
|
|
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
39
|
|
|
40
40
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
41
41
|
|
|
@@ -43,7 +43,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
|
|
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
47
|
|
|
48
48
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
|
|
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
55
|
|
|
56
56
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
57
57
|
|
|
@@ -59,7 +59,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
|
|
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
63
|
|
|
64
64
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
65
65
|
|
|
@@ -67,7 +67,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
|
|
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
71
|
|
|
72
72
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
73
73
|
|
|
@@ -75,7 +75,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
|
|
78
|
-
|
|
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
79
|
|
|
80
80
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
81
81
|
|
|
@@ -83,7 +83,79 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
|
|
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)
|
|
151
|
+
|
|
152
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
# [0.3.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.0) (2025-07-20)
|
|
87
159
|
|
|
88
160
|
**Note:** Version bump only for package @pie-lib/test-utils
|
|
89
161
|
|
|
@@ -91,6 +163,50 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
91
163
|
|
|
92
164
|
|
|
93
165
|
|
|
166
|
+
# [0.4.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.4.0-beta.0) (2025-07-15)
|
|
167
|
+
|
|
168
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
169
|
+
|
|
170
|
+
# [0.3.0-beta.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.33...@pie-lib/test-utils@0.3.0-beta.0) (2025-07-15)
|
|
171
|
+
|
|
172
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
173
|
+
|
|
174
|
+
## [0.2.33](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.32...@pie-lib/test-utils@0.2.33) (2023-06-24)
|
|
175
|
+
|
|
176
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
177
|
+
|
|
178
|
+
## [0.2.32](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.30...@pie-lib/test-utils@0.2.32) (2023-01-31)
|
|
179
|
+
|
|
180
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
181
|
+
|
|
182
|
+
## [0.2.30](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.29...@pie-lib/test-utils@0.2.30) (2023-01-31)
|
|
183
|
+
|
|
184
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
185
|
+
|
|
186
|
+
## [0.2.29](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.28...@pie-lib/test-utils@0.2.29) (2023-01-31)
|
|
187
|
+
|
|
188
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
189
|
+
|
|
190
|
+
## [0.2.28](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.27...@pie-lib/test-utils@0.2.28) (2023-01-31)
|
|
191
|
+
|
|
192
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
193
|
+
|
|
194
|
+
## [0.2.27](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.24...@pie-lib/test-utils@0.2.27) (2023-01-31)
|
|
195
|
+
|
|
196
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
197
|
+
|
|
198
|
+
## [0.2.24](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.22...@pie-lib/test-utils@0.2.24) (2023-01-31)
|
|
199
|
+
|
|
200
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
201
|
+
|
|
202
|
+
## [0.2.22](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.20...@pie-lib/test-utils@0.2.22) (2023-01-31)
|
|
203
|
+
|
|
204
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
205
|
+
|
|
206
|
+
## [0.2.20](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.19...@pie-lib/test-utils@0.2.20) (2022-11-23)
|
|
207
|
+
|
|
208
|
+
**Note:** Version bump only for package @pie-lib/test-utils
|
|
209
|
+
|
|
94
210
|
## [0.2.19](https://github.com/pie-framework/pie-lib/compare/@pie-lib/test-utils@0.2.17...@pie-lib/test-utils@0.2.19) (2021-06-25)
|
|
95
211
|
|
|
96
212
|
**Note:** Version bump only for package @pie-lib/test-utils
|
package/lib/index.js
CHANGED
|
@@ -37,4 +37,4 @@ function shallowChild(Component) {
|
|
|
37
37
|
return rendered;
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
//# sourceMappingURL=
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -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
|
+
"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": "
|
|
16
|
+
"gitHead": "ecb1ca31aa1c24d23af00d5ad04ce73ed8871057",
|
|
17
17
|
"scripts": {}
|
|
18
18
|
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
-
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
|
|
13
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
-
|
|
15
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
|
-
|
|
17
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
18
|
-
|
|
19
|
-
var React = _interopRequireWildcard(require("react"));
|
|
20
|
-
|
|
21
|
-
var _index = require("../index");
|
|
22
|
-
|
|
23
|
-
var _enzyme = _interopRequireDefault(require("enzyme"));
|
|
24
|
-
|
|
25
|
-
var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));
|
|
26
|
-
|
|
27
|
-
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); }
|
|
28
|
-
|
|
29
|
-
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; }
|
|
30
|
-
|
|
31
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
32
|
-
|
|
33
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
34
|
-
|
|
35
|
-
_enzyme["default"].configure({
|
|
36
|
-
adapter: new _enzymeAdapterReact["default"]()
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
describe('test-utils', function () {
|
|
40
|
-
describe('shallowChild', function () {
|
|
41
|
-
function simpleHoC(WrappedComponent) {
|
|
42
|
-
return /*#__PURE__*/function (_React$Component) {
|
|
43
|
-
(0, _inherits2["default"])(_class, _React$Component);
|
|
44
|
-
|
|
45
|
-
var _super = _createSuper(_class);
|
|
46
|
-
|
|
47
|
-
function _class() {
|
|
48
|
-
(0, _classCallCheck2["default"])(this, _class);
|
|
49
|
-
return _super.apply(this, arguments);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
(0, _createClass2["default"])(_class, [{
|
|
53
|
-
key: "render",
|
|
54
|
-
value: function render() {
|
|
55
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(WrappedComponent, (0, _extends2["default"])({
|
|
56
|
-
oneMoreProp: "hello"
|
|
57
|
-
}, this.props)));
|
|
58
|
-
}
|
|
59
|
-
}]);
|
|
60
|
-
return _class;
|
|
61
|
-
}(React.Component);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
var SimpleComponent = /*#__PURE__*/function (_React$Component2) {
|
|
65
|
-
(0, _inherits2["default"])(SimpleComponent, _React$Component2);
|
|
66
|
-
|
|
67
|
-
var _super2 = _createSuper(SimpleComponent);
|
|
68
|
-
|
|
69
|
-
function SimpleComponent() {
|
|
70
|
-
(0, _classCallCheck2["default"])(this, SimpleComponent);
|
|
71
|
-
return _super2.apply(this, arguments);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
(0, _createClass2["default"])(SimpleComponent, [{
|
|
75
|
-
key: "render",
|
|
76
|
-
value: function render() {
|
|
77
|
-
return /*#__PURE__*/React.createElement("span", null, "My simple component will get wrapped");
|
|
78
|
-
}
|
|
79
|
-
}]);
|
|
80
|
-
return SimpleComponent;
|
|
81
|
-
}(React.Component);
|
|
82
|
-
|
|
83
|
-
it('moves past HoC and returns shallow rendered component using enzyme', function () {
|
|
84
|
-
var wrapper = (0, _index.shallowChild)(simpleHoC(SimpleComponent), null, 1);
|
|
85
|
-
var shallowComponent = wrapper();
|
|
86
|
-
expect(shallowComponent.find(SimpleComponent).length).toEqual(1);
|
|
87
|
-
expect(shallowComponent.props().children.props.oneMoreProp).toEqual('hello');
|
|
88
|
-
expect(shallowComponent.html().includes('span')).toEqual(true);
|
|
89
|
-
});
|
|
90
|
-
it('overwrites specific props when passed into the closure', function () {
|
|
91
|
-
var wrapper = (0, _index.shallowChild)(simpleHoC(SimpleComponent), null, 1);
|
|
92
|
-
var shallowComponent = wrapper({
|
|
93
|
-
oneMoreProp: 'helloToo'
|
|
94
|
-
});
|
|
95
|
-
expect(shallowComponent.find(SimpleComponent).length).toEqual(1);
|
|
96
|
-
expect(shallowComponent.props().children.props.oneMoreProp).toEqual('helloToo');
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9fX3Rlc3RzX18vaW5kZXgudGVzdC5qcyJdLCJuYW1lcyI6WyJFbnp5bWUiLCJjb25maWd1cmUiLCJhZGFwdGVyIiwiQWRhcHRlciIsImRlc2NyaWJlIiwic2ltcGxlSG9DIiwiV3JhcHBlZENvbXBvbmVudCIsInByb3BzIiwiUmVhY3QiLCJDb21wb25lbnQiLCJTaW1wbGVDb21wb25lbnQiLCJpdCIsIndyYXBwZXIiLCJzaGFsbG93Q29tcG9uZW50IiwiZXhwZWN0IiwiZmluZCIsImxlbmd0aCIsInRvRXF1YWwiLCJjaGlsZHJlbiIsIm9uZU1vcmVQcm9wIiwiaHRtbCIsImluY2x1ZGVzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7QUFDQTs7QUFDQTs7QUFDQTs7Ozs7Ozs7OztBQUVBQSxtQkFBT0MsU0FBUCxDQUFpQjtBQUFFQyxFQUFBQSxPQUFPLEVBQUUsSUFBSUMsOEJBQUo7QUFBWCxDQUF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