@oclif/test 2.0.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 +611 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/lib/command.d.ts +8 -0
- package/lib/command.js +25 -0
- package/lib/exit.d.ts +13 -0
- package/lib/exit.js +21 -0
- package/lib/hook.d.ts +20 -0
- package/lib/hook.js +27 -0
- package/lib/index.d.ts +114 -0
- package/lib/index.js +20 -0
- package/lib/load-config.d.ts +18 -0
- package/lib/load-config.js +20 -0
- package/package.json +48 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
### [2.0.1](https://github.com/oclif/test/compare/v1.2.8...v2.0.1) (2021-10-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* require node 12+ (#189)
|
|
11
|
+
* update to oclif/core
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* ci ([3297d16](https://github.com/oclif/test/commit/3297d16beeb7fb1b1766584a4f55cb6a1b12519d))
|
|
16
|
+
* release-process ([1d414db](https://github.com/oclif/test/commit/1d414db733e41c630690420e7c8da1610855a4a6))
|
|
17
|
+
* trigger release ([65bd420](https://github.com/oclif/test/commit/65bd420c7e575e27fab56751f1b4f2bc4d6ecc75))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
* Merge pull request #179 from oclif/re/oclif-core ([fedc128](https://github.com/oclif/test/commit/fedc128a6df0fe5aca2a520764f0261af3aadfa4)), closes [#179](https://github.com/oclif/test/issues/179)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### build
|
|
24
|
+
|
|
25
|
+
* require node 12+ ([#189](https://github.com/oclif/test/issues/189)) ([04ac33e](https://github.com/oclif/test/commit/04ac33e34bf5acf9e5cde3f4d8780861d0504b3b))
|
|
26
|
+
|
|
27
|
+
## [1.2.8](https://github.com/oclif/test/compare/v1.2.7...v1.2.8) (2020-12-02)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* **deps:** bump fancy-test from 1.4.9 to 1.4.10 ([#126](https://github.com/oclif/test/issues/126)) ([132c914](https://github.com/oclif/test/commit/132c914d6fcfc92d6a90352706b28769c3ef22e7))
|
|
33
|
+
|
|
34
|
+
## [1.2.7](https://github.com/oclif/test/compare/v1.2.6...v1.2.7) (2020-09-01)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* **deps-dev:** bump eslint from 7.7.0 to 7.8.0 ([#111](https://github.com/oclif/test/issues/111)) ([2d81e06](https://github.com/oclif/test/commit/2d81e0653e0b27d6b3f6e666b63c066d789b154b))
|
|
40
|
+
|
|
41
|
+
## [1.2.2](https://github.com/oclif/test/compare/v1.2.1...v1.2.2) (2018-10-13)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* remove greenkeeper badge ([35730ff](https://github.com/oclif/test/commit/35730ff))
|
|
47
|
+
|
|
48
|
+
## [1.2.1](https://github.com/oclif/test/compare/v1.2.0...v1.2.1) (2018-09-14)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Bug Fixes
|
|
52
|
+
|
|
53
|
+
* require arguments to hook and command ([38982b5](https://github.com/oclif/test/commit/38982b5))
|
|
54
|
+
|
|
55
|
+
# [1.2.0](https://github.com/oclif/test/compare/9af539d38f45f813f825a918baebfee17f9440dc...v1.2.0) (2018-08-17)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Features
|
|
59
|
+
|
|
60
|
+
* typescript 3.0 ([08c44ba](https://github.com/oclif/test/commit/08c44ba))
|
|
61
|
+
|
|
62
|
+
<a name="1.1.0"></a>
|
|
63
|
+
# [1.1.0](https://github.com/oclif/test/compare/bb2466b47bdb57e7852c15f3d8369c296a148db3...v1.1.0) (2018-06-14)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
* updated fancy-test ([9af539d](https://github.com/oclif/test/commit/9af539d))
|
|
69
|
+
|
|
70
|
+
<a name="1.0.9"></a>
|
|
71
|
+
## [1.0.9](https://github.com/oclif/test/compare/a5beadfcd2868abf6680ab1923157fc272e3583d...v1.0.9) (2018-06-01)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Bug Fixes
|
|
75
|
+
|
|
76
|
+
* updated deps ([bb2466b](https://github.com/oclif/test/commit/bb2466b))
|
|
77
|
+
|
|
78
|
+
<a name="1.0.8"></a>
|
|
79
|
+
## [1.0.8](https://github.com/oclif/test/compare/18433ffcb770fcb56a51040419b1a6287ddc686c...v1.0.8) (2018-06-01)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Bug Fixes
|
|
83
|
+
|
|
84
|
+
* updated deps ([a5beadf](https://github.com/oclif/test/commit/a5beadf))
|
|
85
|
+
|
|
86
|
+
<a name="1.0.7"></a>
|
|
87
|
+
## [1.0.7](https://github.com/oclif/test/compare/1073eb5982d805f92a4c0399cd18ae61576c0e3d...v1.0.7) (2018-06-01)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* bump deps ([18433ff](https://github.com/oclif/test/commit/18433ff))
|
|
93
|
+
|
|
94
|
+
<a name="1.0.6"></a>
|
|
95
|
+
## [1.0.6](https://github.com/oclif/test/compare/90e407f6cefec2416f9cf33b572db297d6901769...v1.0.6) (2018-05-01)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### Bug Fixes
|
|
99
|
+
|
|
100
|
+
* updated fancy-test ([1073eb5](https://github.com/oclif/test/commit/1073eb5))
|
|
101
|
+
|
|
102
|
+
<a name="1.0.5"></a>
|
|
103
|
+
## [1.0.5](https://github.com/oclif/test/compare/b30b892e91729769bf2e991ca5922926a7add90b...v1.0.5) (2018-04-18)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
### Bug Fixes
|
|
107
|
+
|
|
108
|
+
* updated deps ([90e407f](https://github.com/oclif/test/commit/90e407f))
|
|
109
|
+
|
|
110
|
+
<a name="1.0.4"></a>
|
|
111
|
+
## [1.0.4](https://github.com/oclif/test/compare/97986a4ea3ac8d703d2c755a29dd9282bd2eb4b1...v1.0.4) (2018-04-06)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
### Bug Fixes
|
|
115
|
+
|
|
116
|
+
* fixed exit ([b30b892](https://github.com/oclif/test/commit/b30b892))
|
|
117
|
+
|
|
118
|
+
<a name="1.0.3"></a>
|
|
119
|
+
## [1.0.3](https://github.com/oclif/test/compare/ad5d869d3ca7afb926f0fbbefc8d92b6c4f1a7ba...v1.0.3) (2018-04-06)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
### Bug Fixes
|
|
123
|
+
|
|
124
|
+
* fixed exit ([97986a4](https://github.com/oclif/test/commit/97986a4))
|
|
125
|
+
|
|
126
|
+
<a name="1.0.2"></a>
|
|
127
|
+
## [1.0.2](https://github.com/oclif/test/compare/65323ebfc55d4c13fb9e4bef2b961a4bc8065a4b...v1.0.2) (2018-04-06)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### Bug Fixes
|
|
131
|
+
|
|
132
|
+
* updated fancy-test ([ad5d869](https://github.com/oclif/test/commit/ad5d869))
|
|
133
|
+
|
|
134
|
+
<a name="1.0.1"></a>
|
|
135
|
+
## [1.0.1](https://github.com/oclif/test/compare/v1.0.0...v1.0.1) (2018-02-13)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Bug Fixes
|
|
139
|
+
|
|
140
|
+
* updated deps ([65323eb](https://github.com/oclif/test/commit/65323eb))
|
|
141
|
+
|
|
142
|
+
<a name="0.10.16"></a>
|
|
143
|
+
## [0.10.16](https://github.com/oclif/test/compare/e3693460c4c91ee8e0f932b28304faaf8ce2f523...v0.10.16) (2018-02-13)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
### Bug Fixes
|
|
147
|
+
|
|
148
|
+
* updated deps ([76353b9](https://github.com/oclif/test/commit/76353b9))
|
|
149
|
+
|
|
150
|
+
<a name="0.10.15"></a>
|
|
151
|
+
## [0.10.15](https://github.com/anycli/test/compare/4b33a6cbc4544870f49b5dc5b7625bf388b5e083...v0.10.15) (2018-02-07)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Bug Fixes
|
|
155
|
+
|
|
156
|
+
* updated command ([18ca930](https://github.com/anycli/test/commit/18ca930))
|
|
157
|
+
|
|
158
|
+
<a name="0.10.14"></a>
|
|
159
|
+
## [0.10.14](https://github.com/anycli/test/compare/25f527145b8548083896f4c440cae92219ddef6c...v0.10.14) (2018-02-07)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
### Bug Fixes
|
|
163
|
+
|
|
164
|
+
* async ([4b33a6c](https://github.com/anycli/test/commit/4b33a6c))
|
|
165
|
+
|
|
166
|
+
<a name="0.10.13"></a>
|
|
167
|
+
## [0.10.13](https://github.com/anycli/test/compare/123a4cf6c04f1e0d86a999b8848b3034174a5c86...v0.10.13) (2018-02-07)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### Bug Fixes
|
|
171
|
+
|
|
172
|
+
* run init hook ([25f5271](https://github.com/anycli/test/commit/25f5271))
|
|
173
|
+
* run init hook ([d902662](https://github.com/anycli/test/commit/d902662))
|
|
174
|
+
|
|
175
|
+
<a name="0.10.12"></a>
|
|
176
|
+
## [0.10.12](https://github.com/anycli/test/compare/e807e1997757ccf16828433cab2ea29a5a8b97be...v0.10.12) (2018-02-07)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
### Bug Fixes
|
|
180
|
+
|
|
181
|
+
* updated config ([123a4cf](https://github.com/anycli/test/commit/123a4cf))
|
|
182
|
+
|
|
183
|
+
<a name="0.10.11"></a>
|
|
184
|
+
## [0.10.11](https://github.com/anycli/test/compare/61c267f0ad0e76ce08b1015cfe76d80769bf4440...v0.10.11) (2018-02-05)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Bug Fixes
|
|
188
|
+
|
|
189
|
+
* updated with config/command changes ([e807e19](https://github.com/anycli/test/commit/e807e19))
|
|
190
|
+
|
|
191
|
+
<a name="0.10.10"></a>
|
|
192
|
+
## [0.10.10](https://github.com/anycli/test/compare/6979084b79f1c39ee6b8c2da201f70d6f0077faf...v0.10.10) (2018-02-05)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
### Bug Fixes
|
|
196
|
+
|
|
197
|
+
* remove lodash ([61c267f](https://github.com/anycli/test/commit/61c267f))
|
|
198
|
+
|
|
199
|
+
<a name="0.10.9"></a>
|
|
200
|
+
## [0.10.9](https://github.com/anycli/test/compare/c1b6e1aa3f5fe2f3ea400a5dda0fe4734e39595c...v0.10.9) (2018-02-03)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
### Bug Fixes
|
|
204
|
+
|
|
205
|
+
* put reset flag on loadConfig ([6979084](https://github.com/anycli/test/commit/6979084))
|
|
206
|
+
|
|
207
|
+
<a name="0.10.8"></a>
|
|
208
|
+
## [0.10.8](https://github.com/anycli/test/compare/83bdc23f9565d74eac32bc28b3a756443b2464dc...v0.10.8) (2018-02-03)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
### Bug Fixes
|
|
212
|
+
|
|
213
|
+
* export command ([c1b6e1a](https://github.com/anycli/test/commit/c1b6e1a))
|
|
214
|
+
|
|
215
|
+
<a name="0.10.7"></a>
|
|
216
|
+
## [0.10.7](https://github.com/anycli/test/compare/54303a06893c4232824e7e91f66464bd4c999ee8...v0.10.7) (2018-02-03)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
### Bug Fixes
|
|
220
|
+
|
|
221
|
+
* bump config ([83bdc23](https://github.com/anycli/test/commit/83bdc23))
|
|
222
|
+
* clear plugincache ([61ec050](https://github.com/anycli/test/commit/61ec050))
|
|
223
|
+
|
|
224
|
+
<a name="0.10.6"></a>
|
|
225
|
+
## [0.10.6](https://github.com/anycli/test/compare/fa184dab258fdb91ff1799c91853c1a8fc140355...v0.10.6) (2018-02-03)
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
### Bug Fixes
|
|
229
|
+
|
|
230
|
+
* fixed loadConfig with hooks ([54303a0](https://github.com/anycli/test/commit/54303a0))
|
|
231
|
+
|
|
232
|
+
<a name="0.10.5"></a>
|
|
233
|
+
## [0.10.5](https://github.com/anycli/test/compare/232226999009377aca4e11d4be0b42292178d8ae...v0.10.5) (2018-02-03)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
### Bug Fixes
|
|
237
|
+
|
|
238
|
+
* updated to work with new config/command ([fa184da](https://github.com/anycli/test/commit/fa184da))
|
|
239
|
+
|
|
240
|
+
<a name="0.10.4"></a>
|
|
241
|
+
## [0.10.4](https://github.com/anycli/test/compare/07edc1c42f32ba3ecc534f4bea0f2db61b0d9955...v0.10.4) (2018-02-02)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
### Bug Fixes
|
|
245
|
+
|
|
246
|
+
* updated deps ([2322269](https://github.com/anycli/test/commit/2322269))
|
|
247
|
+
|
|
248
|
+
<a name="0.10.3"></a>
|
|
249
|
+
## [0.10.3](https://github.com/anycli/test/compare/5fd5b9162030fe7c140e9084e016f15b2fcf20f5...v0.10.3) (2018-02-02)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
### Bug Fixes
|
|
253
|
+
|
|
254
|
+
* updated deps ([07edc1c](https://github.com/anycli/test/commit/07edc1c))
|
|
255
|
+
|
|
256
|
+
<a name="0.10.2"></a>
|
|
257
|
+
## [0.10.2](https://github.com/anycli/test/compare/f69f12493fdd456dd822d70f9698f82cbbc7c90c...v0.10.2) (2018-02-01)
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
### Bug Fixes
|
|
261
|
+
|
|
262
|
+
* lazy load engine ([5fd5b91](https://github.com/anycli/test/commit/5fd5b91))
|
|
263
|
+
|
|
264
|
+
<a name="0.10.1"></a>
|
|
265
|
+
## [0.10.1](https://github.com/anycli/test/compare/ac8b8ad827acddd1f06b2f47941543d1497e9f59...v0.10.1) (2018-02-01)
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
### Bug Fixes
|
|
269
|
+
|
|
270
|
+
* updated engine ([f69f124](https://github.com/anycli/test/commit/f69f124))
|
|
271
|
+
|
|
272
|
+
<a name="0.10.0"></a>
|
|
273
|
+
# [0.10.0](https://github.com/anycli/test/compare/815def79357243b1f4d572609d2a0fe3a795be8c...v0.10.0) (2018-01-31)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
### Features
|
|
277
|
+
|
|
278
|
+
* added loadEngine ([ac8b8ad](https://github.com/anycli/test/commit/ac8b8ad))
|
|
279
|
+
|
|
280
|
+
<a name="0.9.20"></a>
|
|
281
|
+
## [0.9.20](https://github.com/anycli/test/compare/v0.9.19...v0.9.20) (2018-01-31)
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
### Bug Fixes
|
|
285
|
+
|
|
286
|
+
* anycli rename ([815def7](https://github.com/anycli/test/commit/815def7))
|
|
287
|
+
* anycli rename ([ca39cc9](https://github.com/anycli/test/commit/ca39cc9))
|
|
288
|
+
|
|
289
|
+
<a name="0.9.19"></a>
|
|
290
|
+
## [0.9.19](https://github.com/dxcli/test/compare/46ce619516b71b5b285090f31a151119d9d93fce...v0.9.19) (2018-01-29)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
### Bug Fixes
|
|
294
|
+
|
|
295
|
+
* updated engine ([6d396b1](https://github.com/dxcli/test/commit/6d396b1))
|
|
296
|
+
|
|
297
|
+
<a name="0.9.18"></a>
|
|
298
|
+
## [0.9.18](https://github.com/dxcli/test/compare/6c0a79775313da04ac3df1520af1144426deebd3...v0.9.18) (2018-01-28)
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
### Bug Fixes
|
|
302
|
+
|
|
303
|
+
* remove peer dep ([46ce619](https://github.com/dxcli/test/commit/46ce619))
|
|
304
|
+
|
|
305
|
+
<a name="0.9.17"></a>
|
|
306
|
+
## [0.9.17](https://github.com/dxcli/test/compare/11b76681d9fbb4b5519f08b097a8abf38b277bd1...v0.9.17) (2018-01-28)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
### Bug Fixes
|
|
310
|
+
|
|
311
|
+
* add [@dxcli](https://github.com/dxcli)/command ([6c0a797](https://github.com/dxcli/test/commit/6c0a797))
|
|
312
|
+
* fixing example publishing ([adee5fe](https://github.com/dxcli/test/commit/adee5fe))
|
|
313
|
+
|
|
314
|
+
<a name="0.9.16"></a>
|
|
315
|
+
## [0.9.16](https://github.com/dxcli/test/compare/43dfa2997d4d3889d6a5af0300a1310f5f727eb2...v0.9.16) (2018-01-28)
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
### Bug Fixes
|
|
319
|
+
|
|
320
|
+
* fixed config loading ([11b7668](https://github.com/dxcli/test/commit/11b7668))
|
|
321
|
+
|
|
322
|
+
<a name="0.9.15"></a>
|
|
323
|
+
## [0.9.15](https://github.com/dxcli/test/compare/1c361aa61eabdd02a887339d656eb06f86244a4c...v0.9.15) (2018-01-28)
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
### Bug Fixes
|
|
327
|
+
|
|
328
|
+
* updated fancy-test ([43dfa29](https://github.com/dxcli/test/commit/43dfa29))
|
|
329
|
+
|
|
330
|
+
<a name="0.9.14"></a>
|
|
331
|
+
## [0.9.14](https://github.com/dxcli/test/compare/1c9f8a395b48bf0489afb3badc5eef02dd9acb36...v0.9.14) (2018-01-28)
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
### Bug Fixes
|
|
335
|
+
|
|
336
|
+
* ran generator ([1c361aa](https://github.com/dxcli/test/commit/1c361aa))
|
|
337
|
+
|
|
338
|
+
<a name="0.9.13"></a>
|
|
339
|
+
## [0.9.13](https://github.com/dxcli/test/compare/9e620edba0962ffb08182f166cff6c6db0c759ce...v0.9.13) (2018-01-28)
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
### Bug Fixes
|
|
343
|
+
|
|
344
|
+
* ran generator ([1c9f8a3](https://github.com/dxcli/test/commit/1c9f8a3))
|
|
345
|
+
|
|
346
|
+
<a name="0.9.12"></a>
|
|
347
|
+
## [0.9.12](https://github.com/dxcli/dev-test/compare/d800eb1e0453b4dc928e103ad8384b7a4285d596...v0.9.12) (2018-01-27)
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
### Bug Fixes
|
|
351
|
+
|
|
352
|
+
* updated deps ([11e18c0](https://github.com/dxcli/dev-test/commit/11e18c0))
|
|
353
|
+
|
|
354
|
+
<a name="0.9.11"></a>
|
|
355
|
+
## [0.9.11](https://github.com/dxcli/dev-test/compare/d4a55140333f0cc4ba0601b975dcd2f8f746c739...v0.9.11) (2018-01-27)
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
### Bug Fixes
|
|
359
|
+
|
|
360
|
+
* move everything to devDependencies to use [@dxcli](https://github.com/dxcli)/dev instead ([d800eb1](https://github.com/dxcli/dev-test/commit/d800eb1))
|
|
361
|
+
|
|
362
|
+
<a name="0.9.10"></a>
|
|
363
|
+
## [0.9.10](https://github.com/dxcli/dev-test/compare/2473c2f8dbc9fb30aa49d7319cd8c0367a030e5b...v0.9.10) (2018-01-27)
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
### Bug Fixes
|
|
367
|
+
|
|
368
|
+
* added types ([d4a5514](https://github.com/dxcli/dev-test/commit/d4a5514))
|
|
369
|
+
|
|
370
|
+
<a name="0.9.9"></a>
|
|
371
|
+
## [0.9.9](https://github.com/dxcli/dev-test/compare/7c2f91a8ac9d82873fe2661c9b8a075b9a04791e...v0.9.9) (2018-01-27)
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
### Bug Fixes
|
|
375
|
+
|
|
376
|
+
* updated deps ([2473c2f](https://github.com/dxcli/dev-test/commit/2473c2f))
|
|
377
|
+
|
|
378
|
+
<a name="0.9.8"></a>
|
|
379
|
+
## [0.9.8](https://github.com/dxcli/dev-test/compare/46b00dbd6ef575ccc35caa31580beb636656c595...v0.9.8) (2018-01-26)
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
### Bug Fixes
|
|
383
|
+
|
|
384
|
+
* updated deps ([7c2f91a](https://github.com/dxcli/dev-test/commit/7c2f91a))
|
|
385
|
+
|
|
386
|
+
<a name="0.9.7"></a>
|
|
387
|
+
## [0.9.7](https://github.com/dxcli/dev-test/compare/319439d66a91a6f733cf67f30fc9ba9730cbd4f0...v0.9.7) (2018-01-26)
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
### Bug Fixes
|
|
391
|
+
|
|
392
|
+
* updated fancy-test ([46b00db](https://github.com/dxcli/dev-test/commit/46b00db))
|
|
393
|
+
|
|
394
|
+
<a name="0.9.6"></a>
|
|
395
|
+
## [0.9.6](https://github.com/dxcli/dev-test/compare/b930f9d913b48981781e064317869f932e16730f...v0.9.6) (2018-01-26)
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
### Bug Fixes
|
|
399
|
+
|
|
400
|
+
* updated fancy-test ([319439d](https://github.com/dxcli/dev-test/commit/319439d))
|
|
401
|
+
|
|
402
|
+
<a name="0.9.5"></a>
|
|
403
|
+
## [0.9.5](https://github.com/dxcli/dev-test/compare/ed2562de6b7073e6a9db4f051aeec925d2cca539...v0.9.5) (2018-01-26)
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
### Bug Fixes
|
|
407
|
+
|
|
408
|
+
* updated fancy-test ([b930f9d](https://github.com/dxcli/dev-test/commit/b930f9d))
|
|
409
|
+
|
|
410
|
+
<a name="0.9.4"></a>
|
|
411
|
+
## [0.9.4](https://github.com/dxcli/dev-test/compare/639c410f45e9a361417acba72586fe6e4d294fe5...v0.9.4) (2018-01-26)
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
### Bug Fixes
|
|
415
|
+
|
|
416
|
+
* updated fancy-test ([ed2562d](https://github.com/dxcli/dev-test/commit/ed2562d))
|
|
417
|
+
|
|
418
|
+
<a name="0.9.3"></a>
|
|
419
|
+
## [0.9.3](https://github.com/dxcli/dev-test/compare/f0f450e8ecfa1600ba329f30811a10432e56f5d0...v0.9.3) (2018-01-26)
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
### Bug Fixes
|
|
423
|
+
|
|
424
|
+
* updated fancy-test ([39078f0](https://github.com/dxcli/dev-test/commit/39078f0))
|
|
425
|
+
|
|
426
|
+
<a name="0.9.2"></a>
|
|
427
|
+
## [0.9.2](https://github.com/dxcli/dev-test/compare/275ae1e49fc427d9e9093f931ba9668ecddb5d0b...v0.9.2) (2018-01-25)
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
### Bug Fixes
|
|
431
|
+
|
|
432
|
+
* added some exports ([f0f450e](https://github.com/dxcli/dev-test/commit/f0f450e))
|
|
433
|
+
* updated fancy-mocha ([8420ab2](https://github.com/dxcli/dev-test/commit/8420ab2))
|
|
434
|
+
* updated fancy-mocha ([d78793e](https://github.com/dxcli/dev-test/commit/d78793e))
|
|
435
|
+
|
|
436
|
+
<a name="0.9.1"></a>
|
|
437
|
+
## [0.9.1](https://github.com/dxcli/dev-test/compare/89d55b19ebdd7c04daad9c5156b4b62fb36d22ce...v0.9.1) (2018-01-25)
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
### Bug Fixes
|
|
441
|
+
|
|
442
|
+
* fix defaulting root ([275ae1e](https://github.com/dxcli/dev-test/commit/275ae1e))
|
|
443
|
+
|
|
444
|
+
<a name="0.9.0"></a>
|
|
445
|
+
# [0.9.0](https://github.com/dxcli/dev-test/compare/b7a1d2557905ffd8b59ab1333d236b5e768301e3...v0.9.0) (2018-01-25)
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
### Features
|
|
449
|
+
|
|
450
|
+
* use fancy-mocha ([89d55b1](https://github.com/dxcli/dev-test/commit/89d55b1))
|
|
451
|
+
|
|
452
|
+
<a name="0.8.0"></a>
|
|
453
|
+
# [0.8.0](https://github.com/dxcli/dev-test/compare/036ec315486d5caf3af301df37f9c252ecb64fe4...v0.8.0) (2018-01-21)
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
### Features
|
|
457
|
+
|
|
458
|
+
* use fancy-mocha ([b7a1d25](https://github.com/dxcli/dev-test/commit/b7a1d25))
|
|
459
|
+
|
|
460
|
+
<a name="0.7.0"></a>
|
|
461
|
+
# [0.7.0](https://github.com/dxcli/dev-test/compare/5b214ad519747c8e999dae7ae809b680c4373f63...v0.7.0) (2018-01-20)
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
### Features
|
|
465
|
+
|
|
466
|
+
* added error to hook callback ([036ec31](https://github.com/dxcli/dev-test/commit/036ec31))
|
|
467
|
+
|
|
468
|
+
<a name="0.6.1"></a>
|
|
469
|
+
## [0.6.1](https://github.com/dxcli/dev-test/compare/e5f9a87977d3d7cc901297874b0135def95362d2...v0.6.1) (2018-01-20)
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
### Bug Fixes
|
|
473
|
+
|
|
474
|
+
* better exit error handling ([5b214ad](https://github.com/dxcli/dev-test/commit/5b214ad))
|
|
475
|
+
|
|
476
|
+
<a name="0.6.0"></a>
|
|
477
|
+
# [0.6.0](https://github.com/dxcli/dev-test/compare/9606dddb2a1420ee0384b27f5c84c3c73d2e161e...v0.6.0) (2018-01-20)
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
### Features
|
|
481
|
+
|
|
482
|
+
* added testHook callback ([e5f9a87](https://github.com/dxcli/dev-test/commit/e5f9a87))
|
|
483
|
+
|
|
484
|
+
<a name="0.5.2"></a>
|
|
485
|
+
## [0.5.2](https://github.com/dxcli/dev-test/compare/b578460b88d0c4079d4749ecaaf2a35796715d3c...v0.5.2) (2018-01-20)
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
### Bug Fixes
|
|
489
|
+
|
|
490
|
+
* updated deps ([3dabf24](https://github.com/dxcli/dev-test/commit/3dabf24))
|
|
491
|
+
|
|
492
|
+
<a name="0.5.1"></a>
|
|
493
|
+
## [0.5.1](https://github.com/dxcli/dev-test/compare/016ca5eba672058d70bf9bff6df64653ac29f3cd...v0.5.1) (2018-01-20)
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
### Bug Fixes
|
|
497
|
+
|
|
498
|
+
* show all args ([b578460](https://github.com/dxcli/dev-test/commit/b578460))
|
|
499
|
+
|
|
500
|
+
<a name="0.5.0"></a>
|
|
501
|
+
# [0.5.0](https://github.com/dxcli/dev-test/compare/0ccdabed9721ba044e8d5a75db391c0f126d6e54...v0.5.0) (2018-01-20)
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
### Features
|
|
505
|
+
|
|
506
|
+
* added testCommand callback ([016ca5e](https://github.com/dxcli/dev-test/commit/016ca5e))
|
|
507
|
+
|
|
508
|
+
<a name="0.4.4"></a>
|
|
509
|
+
## [0.4.4](https://github.com/dxcli/dev-test/compare/c9d091091f0faeb52d11fd3897c22de413634bd5...v0.4.4) (2018-01-20)
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
### Bug Fixes
|
|
513
|
+
|
|
514
|
+
* bump engine ([0ccdabe](https://github.com/dxcli/dev-test/commit/0ccdabe))
|
|
515
|
+
|
|
516
|
+
<a name="0.4.3"></a>
|
|
517
|
+
## [0.4.3](https://github.com/dxcli/dev-test/compare/306c3ee9d27460a56bf3be1d9f31ea8e14084a23...v0.4.3) (2018-01-20)
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
### Bug Fixes
|
|
521
|
+
|
|
522
|
+
* exit code check ([c9d0910](https://github.com/dxcli/dev-test/commit/c9d0910))
|
|
523
|
+
|
|
524
|
+
<a name="0.4.2"></a>
|
|
525
|
+
## [0.4.2](https://github.com/dxcli/dev-test/compare/28b9e3b1cde70174831a2d175f6d7c542e59fb72...v0.4.2) (2018-01-20)
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
### Bug Fixes
|
|
529
|
+
|
|
530
|
+
* updated deps ([306c3ee](https://github.com/dxcli/dev-test/commit/306c3ee))
|
|
531
|
+
|
|
532
|
+
<a name="0.4.1"></a>
|
|
533
|
+
## [0.4.1](https://github.com/dxcli/dev-test/compare/39bc87761d4cce79d38ed69a66592ac499d6347e...v0.4.1) (2018-01-20)
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
### Bug Fixes
|
|
537
|
+
|
|
538
|
+
* added sourceMap ([e17e4aa](https://github.com/dxcli/dev-test/commit/e17e4aa))
|
|
539
|
+
* updated dependencies ([28b9e3b](https://github.com/dxcli/dev-test/commit/28b9e3b))
|
|
540
|
+
|
|
541
|
+
<a name="0.4.0"></a>
|
|
542
|
+
# [0.4.0](https://github.com/dxcli/dev-test/compare/bbe7683a7e6eb0c27e387e9d085dae0f669fb867...v0.4.0) (2018-01-20)
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
### Features
|
|
546
|
+
|
|
547
|
+
* added testHook ([39bc877](https://github.com/dxcli/dev-test/commit/39bc877))
|
|
548
|
+
|
|
549
|
+
<a name="0.3.0"></a>
|
|
550
|
+
# [0.3.0](https://github.com/dxcli/dev-test/compare/8ef663ff285bd3a65d2f8e6520a3b56ac8b48d7e...v0.3.0) (2018-01-20)
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
### Features
|
|
554
|
+
|
|
555
|
+
* added testCommand ([bbe7683](https://github.com/dxcli/dev-test/commit/bbe7683))
|
|
556
|
+
|
|
557
|
+
<a name="0.2.2"></a>
|
|
558
|
+
## [0.2.2](https://github.com/dxcli/dev-test/compare/6384b05e572a67a8ac9df47c2d1824015ada6e4a...v0.2.2) (2018-01-19)
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
### Bug Fixes
|
|
562
|
+
|
|
563
|
+
* updated dependencies ([8ef663f](https://github.com/dxcli/dev-test/commit/8ef663f))
|
|
564
|
+
|
|
565
|
+
<a name="0.2.1"></a>
|
|
566
|
+
## [0.2.1](https://github.com/dxcli/dev-test/compare/4d45e11aebd9a69549aefdc54fa15ebb2ddf24f0...v0.2.1) (2018-01-16)
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
### Bug Fixes
|
|
570
|
+
|
|
571
|
+
* flush stdmock after tests ([6384b05](https://github.com/dxcli/dev-test/commit/6384b05))
|
|
572
|
+
|
|
573
|
+
<a name="0.2.0"></a>
|
|
574
|
+
# [0.2.0](https://github.com/dxcli/dev-test/compare/98bf3a1dd7346d4d8d71fa9c943dc2c23f0171ff...v0.2.0) (2018-01-16)
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
### Features
|
|
578
|
+
|
|
579
|
+
* add chai-as-promised ([4d45e11](https://github.com/dxcli/dev-test/commit/4d45e11))
|
|
580
|
+
|
|
581
|
+
<a name="0.1.2"></a>
|
|
582
|
+
## [0.1.2](https://github.com/dxcli/dev-test/compare/77aff3b2da0b9e72548d6584128dbe6bb56e39e4...v0.1.2) (2018-01-16)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
### Bug Fixes
|
|
586
|
+
|
|
587
|
+
* fixed it before/after filters ([98bf3a1](https://github.com/dxcli/dev-test/commit/98bf3a1))
|
|
588
|
+
|
|
589
|
+
<a name="0.1.1"></a>
|
|
590
|
+
## [0.1.1](https://github.com/dxcli/dev-test/compare/d0c1e97a377cb47071d387ed38e2b905437c3d80...v0.1.1) (2018-01-16)
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
### Bug Fixes
|
|
594
|
+
|
|
595
|
+
* ran generator ([77aff3b](https://github.com/dxcli/dev-test/commit/77aff3b))
|
|
596
|
+
|
|
597
|
+
<a name="0.1.0"></a>
|
|
598
|
+
# [0.1.0](https://github.com/dxcli/dev-test/compare/1994d4b85deedb04d87973b56e8fff359dd7dd31...v0.1.0) (2018-01-15)
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
### Features
|
|
602
|
+
|
|
603
|
+
* added mock and improved std mocking ([d0c1e97](https://github.com/dxcli/dev-test/commit/d0c1e97))
|
|
604
|
+
|
|
605
|
+
<a name="0.0.1"></a>
|
|
606
|
+
## [0.0.1](https://github.com/dxcli/dev-test/compare/16a7ac9e499c1b587bc6d42ee963cecdb5ce029c...v0.0.1) (2018-01-13)
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
### Bug Fixes
|
|
610
|
+
|
|
611
|
+
* add [@dxcli](https://github.com/dxcli)/dev-nyc-config ([1994d4b](https://github.com/dxcli/dev-test/commit/1994d4b))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Salesforce.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@oclif/test
|
|
2
|
+
============
|
|
3
|
+
|
|
4
|
+
test helpers for oclif components
|
|
5
|
+
|
|
6
|
+
[](https://npmjs.org/package/@oclif/test)
|
|
7
|
+
[](https://circleci.com/gh/oclif/test/tree/master)
|
|
8
|
+
[](https://ci.appveyor.com/project/heroku/test/branch/master)
|
|
9
|
+
[](https://snyk.io/test/npm/@oclif/test)
|
|
10
|
+
[](https://npmjs.org/package/@oclif/test)
|
|
11
|
+
[](https://github.com/oclif/test/blob/master/package.json)
|
package/lib/command.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Interfaces } from '@oclif/core';
|
|
2
|
+
import { loadConfig } from './load-config';
|
|
3
|
+
export declare function command(args: string[] | string, opts?: loadConfig.Options): {
|
|
4
|
+
run(ctx: {
|
|
5
|
+
config: Interfaces.Config;
|
|
6
|
+
expectation: string;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
};
|
package/lib/command.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const load_config_1 = require("./load-config");
|
|
5
|
+
const castArray = (input) => {
|
|
6
|
+
if (input === undefined)
|
|
7
|
+
return [];
|
|
8
|
+
return Array.isArray(input) ? input : [input];
|
|
9
|
+
};
|
|
10
|
+
function command(args, opts = {}) {
|
|
11
|
+
return {
|
|
12
|
+
async run(ctx) {
|
|
13
|
+
// eslint-disable-next-line require-atomic-updates
|
|
14
|
+
if (!ctx.config || opts.reset)
|
|
15
|
+
ctx.config = await (0, load_config_1.loadConfig)(opts).run({});
|
|
16
|
+
args = castArray(args);
|
|
17
|
+
const [id, ...extra] = args;
|
|
18
|
+
// eslint-disable-next-line require-atomic-updates
|
|
19
|
+
ctx.expectation = ctx.expectation || `runs ${args.join(' ')}`;
|
|
20
|
+
await ctx.config.runHook('init', { id, argv: extra });
|
|
21
|
+
await ctx.config.runCommand(id, extra);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.command = command;
|
package/lib/exit.d.ts
ADDED
package/lib/exit.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const chai_1 = require("chai");
|
|
4
|
+
// eslint-disable-next-line valid-jsdoc
|
|
5
|
+
/**
|
|
6
|
+
* ensures that a oclif command or hook exits
|
|
7
|
+
*
|
|
8
|
+
* @param {number} code expected code
|
|
9
|
+
* @default 0
|
|
10
|
+
*/
|
|
11
|
+
exports.default = (code = 0) => ({
|
|
12
|
+
run() {
|
|
13
|
+
(0, chai_1.expect)(process.exitCode).to.equal(code);
|
|
14
|
+
throw new Error(`Expected to exit with code ${code} but it ran without exiting`);
|
|
15
|
+
},
|
|
16
|
+
catch(ctx) {
|
|
17
|
+
if (!ctx.error.oclif || ctx.error.oclif.exit === undefined)
|
|
18
|
+
throw ctx.error;
|
|
19
|
+
(0, chai_1.expect)(ctx.error.oclif.exit).to.equal(code);
|
|
20
|
+
},
|
|
21
|
+
});
|
package/lib/hook.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Interfaces } from '@oclif/core';
|
|
2
|
+
import { loadConfig } from './load-config';
|
|
3
|
+
declare const _default: (event: string, hookOpts?: object, options?: loadConfig.Options) => {
|
|
4
|
+
run(ctx: {
|
|
5
|
+
config: Interfaces.Config;
|
|
6
|
+
expectation: string;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* tests a oclif hook
|
|
11
|
+
*
|
|
12
|
+
* @example <caption>check that when the 'init' hook is ran it outputs "this output"</caption>
|
|
13
|
+
* testHook('init', {id: 'mycommand'}, {stdout: true}, output => {
|
|
14
|
+
* expect(output.stdout).to.contain('this output')
|
|
15
|
+
* })
|
|
16
|
+
*
|
|
17
|
+
* @param {string} event hook to run
|
|
18
|
+
* @param {object} hookOpts options to pass to hook. Config object will be passed automatically.
|
|
19
|
+
*/
|
|
20
|
+
export default _default;
|
package/lib/hook.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const load_config_1 = require("./load-config");
|
|
4
|
+
// eslint-disable-next-line valid-jsdoc
|
|
5
|
+
/**
|
|
6
|
+
* tests a oclif hook
|
|
7
|
+
*
|
|
8
|
+
* @example <caption>check that when the 'init' hook is ran it outputs "this output"</caption>
|
|
9
|
+
* testHook('init', {id: 'mycommand'}, {stdout: true}, output => {
|
|
10
|
+
* expect(output.stdout).to.contain('this output')
|
|
11
|
+
* })
|
|
12
|
+
*
|
|
13
|
+
* @param {string} event hook to run
|
|
14
|
+
* @param {object} hookOpts options to pass to hook. Config object will be passed automatically.
|
|
15
|
+
*/
|
|
16
|
+
exports.default = (event, hookOpts = {}, options = {}) => ({
|
|
17
|
+
async run(ctx) {
|
|
18
|
+
if (!event)
|
|
19
|
+
throw new Error('no hook provided');
|
|
20
|
+
// eslint-disable-next-line require-atomic-updates
|
|
21
|
+
if (!ctx.config)
|
|
22
|
+
ctx.config = await (0, load_config_1.loadConfig)(options).run({});
|
|
23
|
+
// eslint-disable-next-line require-atomic-updates
|
|
24
|
+
ctx.expectation = ctx.expectation || `runs ${event} hook`;
|
|
25
|
+
await ctx.config.runHook(event, hookOpts || {});
|
|
26
|
+
},
|
|
27
|
+
});
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Config } from '@oclif/core';
|
|
2
|
+
import { expect, FancyTypes } from 'fancy-test';
|
|
3
|
+
import { command } from './command';
|
|
4
|
+
import { loadConfig } from './load-config';
|
|
5
|
+
export declare const test: FancyTypes.Base<FancyTypes.Context, {
|
|
6
|
+
skip: {
|
|
7
|
+
output: unknown;
|
|
8
|
+
args: [];
|
|
9
|
+
};
|
|
10
|
+
} & {
|
|
11
|
+
only: {
|
|
12
|
+
output: unknown;
|
|
13
|
+
args: [];
|
|
14
|
+
};
|
|
15
|
+
} & {
|
|
16
|
+
retries: {
|
|
17
|
+
output: unknown;
|
|
18
|
+
args: [number];
|
|
19
|
+
};
|
|
20
|
+
} & {
|
|
21
|
+
catch: {
|
|
22
|
+
output: {
|
|
23
|
+
error: Error;
|
|
24
|
+
};
|
|
25
|
+
args: [string | RegExp | ((err: Error) => any), ({
|
|
26
|
+
raiseIfNotThrown?: boolean | undefined;
|
|
27
|
+
} | undefined)?];
|
|
28
|
+
};
|
|
29
|
+
} & {
|
|
30
|
+
env: {
|
|
31
|
+
output: unknown;
|
|
32
|
+
args: [{
|
|
33
|
+
[k: string]: string | null | undefined;
|
|
34
|
+
}, (FancyTypes.EnvOptions | undefined)?];
|
|
35
|
+
};
|
|
36
|
+
} & {
|
|
37
|
+
stub: {
|
|
38
|
+
output: {
|
|
39
|
+
stubs: any[];
|
|
40
|
+
};
|
|
41
|
+
args: [any, any, () => any];
|
|
42
|
+
};
|
|
43
|
+
} & {
|
|
44
|
+
stdin: {
|
|
45
|
+
output: unknown;
|
|
46
|
+
args: [string, (number | undefined)?];
|
|
47
|
+
};
|
|
48
|
+
} & {
|
|
49
|
+
stderr: {
|
|
50
|
+
output: {
|
|
51
|
+
readonly stderr: string;
|
|
52
|
+
};
|
|
53
|
+
args: [({
|
|
54
|
+
print?: boolean | undefined;
|
|
55
|
+
stripColor?: boolean | undefined;
|
|
56
|
+
} | undefined)?];
|
|
57
|
+
};
|
|
58
|
+
} & {
|
|
59
|
+
stdout: {
|
|
60
|
+
output: {
|
|
61
|
+
readonly stdout: string;
|
|
62
|
+
};
|
|
63
|
+
args: [({
|
|
64
|
+
print?: boolean | undefined;
|
|
65
|
+
stripColor?: boolean | undefined;
|
|
66
|
+
} | undefined)?];
|
|
67
|
+
};
|
|
68
|
+
} & {
|
|
69
|
+
nock: {
|
|
70
|
+
output: {
|
|
71
|
+
nock: number;
|
|
72
|
+
};
|
|
73
|
+
args: [string, FancyTypes.NockOptions | FancyTypes.NockCallback, (FancyTypes.NockCallback | undefined)?];
|
|
74
|
+
};
|
|
75
|
+
} & {
|
|
76
|
+
timeout: {
|
|
77
|
+
output: {
|
|
78
|
+
timeout: number;
|
|
79
|
+
};
|
|
80
|
+
args: [(number | undefined)?];
|
|
81
|
+
};
|
|
82
|
+
} & {
|
|
83
|
+
loadConfig: {
|
|
84
|
+
output: {
|
|
85
|
+
config: import("@oclif/core/lib/interfaces").Config;
|
|
86
|
+
};
|
|
87
|
+
args: [opts?: loadConfig.Options | undefined];
|
|
88
|
+
};
|
|
89
|
+
} & {
|
|
90
|
+
command: {
|
|
91
|
+
output: {
|
|
92
|
+
config: import("@oclif/core/lib/interfaces").Config;
|
|
93
|
+
expectation: string;
|
|
94
|
+
};
|
|
95
|
+
args: [args: string | string[], opts?: loadConfig.Options | undefined];
|
|
96
|
+
};
|
|
97
|
+
} & {
|
|
98
|
+
exit: {
|
|
99
|
+
output: {
|
|
100
|
+
error: any;
|
|
101
|
+
};
|
|
102
|
+
args: [code?: number | undefined];
|
|
103
|
+
};
|
|
104
|
+
} & {
|
|
105
|
+
hook: {
|
|
106
|
+
output: {
|
|
107
|
+
config: import("@oclif/core/lib/interfaces").Config;
|
|
108
|
+
expectation: string;
|
|
109
|
+
};
|
|
110
|
+
args: [event: string, hookOpts?: object | undefined, options?: loadConfig.Options | undefined];
|
|
111
|
+
};
|
|
112
|
+
}>;
|
|
113
|
+
export default test;
|
|
114
|
+
export { expect, FancyTypes, Config, command, };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = exports.Config = exports.FancyTypes = exports.expect = exports.test = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return core_1.Config; } });
|
|
6
|
+
const fancy_test_1 = require("fancy-test");
|
|
7
|
+
Object.defineProperty(exports, "expect", { enumerable: true, get: function () { return fancy_test_1.expect; } });
|
|
8
|
+
Object.defineProperty(exports, "FancyTypes", { enumerable: true, get: function () { return fancy_test_1.FancyTypes; } });
|
|
9
|
+
const command_1 = require("./command");
|
|
10
|
+
Object.defineProperty(exports, "command", { enumerable: true, get: function () { return command_1.command; } });
|
|
11
|
+
const exit_1 = require("./exit");
|
|
12
|
+
const hook_1 = require("./hook");
|
|
13
|
+
const load_config_1 = require("./load-config");
|
|
14
|
+
load_config_1.loadConfig.root = module.parent.filename;
|
|
15
|
+
exports.test = fancy_test_1.fancy
|
|
16
|
+
.register('loadConfig', load_config_1.loadConfig)
|
|
17
|
+
.register('command', command_1.command)
|
|
18
|
+
.register('exit', exit_1.default)
|
|
19
|
+
.register('hook', hook_1.default);
|
|
20
|
+
exports.default = exports.test;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Interfaces, Config } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* loads CLI plugin/multi config
|
|
4
|
+
* @param {loadConfig.Options} opts options
|
|
5
|
+
* @return {Promise<Interfaces.Config>} config
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadConfig(opts?: loadConfig.Options): {
|
|
8
|
+
run(ctx: {
|
|
9
|
+
config: Interfaces.Config;
|
|
10
|
+
}): Promise<Interfaces.Config>;
|
|
11
|
+
};
|
|
12
|
+
export declare namespace loadConfig {
|
|
13
|
+
let root: string;
|
|
14
|
+
interface Options {
|
|
15
|
+
root?: string;
|
|
16
|
+
reset?: boolean;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadConfig = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
/**
|
|
6
|
+
* loads CLI plugin/multi config
|
|
7
|
+
* @param {loadConfig.Options} opts options
|
|
8
|
+
* @return {Promise<Interfaces.Config>} config
|
|
9
|
+
*/
|
|
10
|
+
function loadConfig(opts = {}) {
|
|
11
|
+
return {
|
|
12
|
+
async run(ctx) {
|
|
13
|
+
ctx.config = await core_1.Config.load(opts.root || loadConfig.root);
|
|
14
|
+
return ctx.config;
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
exports.loadConfig = loadConfig;
|
|
19
|
+
(function (loadConfig) {
|
|
20
|
+
})(loadConfig = exports.loadConfig || (exports.loadConfig = {}));
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oclif/test",
|
|
3
|
+
"description": "test helpers for oclif components",
|
|
4
|
+
"version": "2.0.1",
|
|
5
|
+
"author": "Jeff Dickey @jdxcode",
|
|
6
|
+
"bugs": "https://github.com/oclif/test/issues",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"fancy-test": "^1.4.3"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@oclif/core": "^0.5.27",
|
|
12
|
+
"@types/chai": "^4.1.7",
|
|
13
|
+
"@types/mocha": "^8.0.0",
|
|
14
|
+
"@types/node": "^14.0.14",
|
|
15
|
+
"chai": "^4.2.0",
|
|
16
|
+
"eslint": "^7.3.1",
|
|
17
|
+
"eslint-config-oclif": "^3.1.0",
|
|
18
|
+
"eslint-config-oclif-typescript": "^0.2.0",
|
|
19
|
+
"globby": "^11.0.1",
|
|
20
|
+
"mocha": "^8.2.1",
|
|
21
|
+
"nock": "^13.0.1",
|
|
22
|
+
"shx": "^0.3.3",
|
|
23
|
+
"ts-node": "^9.0.0",
|
|
24
|
+
"typescript": "4.4.3"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=12.0.0"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"/lib"
|
|
31
|
+
],
|
|
32
|
+
"homepage": "https://github.com/oclif/test",
|
|
33
|
+
"keywords": [
|
|
34
|
+
"oclif"
|
|
35
|
+
],
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"main": "lib/index.js",
|
|
38
|
+
"repository": "oclif/test",
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "shx rm -rf lib && tsc",
|
|
41
|
+
"lint": "eslint . --ext .ts --config .eslintrc",
|
|
42
|
+
"posttest": "yarn lint",
|
|
43
|
+
"prepublishOnly": "yarn run build",
|
|
44
|
+
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
45
|
+
"pretest": "yarn build --noEmit && tsc -p test --noEmit"
|
|
46
|
+
},
|
|
47
|
+
"types": "lib/index.d.ts"
|
|
48
|
+
}
|