@sprucelabs/spruce-cli 15.1.8 → 15.2.3
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 +35 -0
- package/build/__tests__/behavioral/AddingADependency.test.js.map +1 -1
- package/build/__tests__/behavioral/UpgradingANodeModule.test.js.map +1 -1
- package/build/__tests__/behavioral/events/CreatingAnEvent.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/CreatingATest.test.d.ts +9 -1
- package/build/__tests__/behavioral/tests/CreatingATest.test.js +316 -26
- package/build/__tests__/behavioral/tests/CreatingATest.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.d.ts +5 -0
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js +331 -160
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js.map +1 -1
- package/build/features/test/actions/CreateAction.d.ts +2 -0
- package/build/features/test/actions/CreateAction.js +147 -46
- package/build/features/test/actions/CreateAction.js.map +1 -1
- package/build/tests/utilities/uiAssert.utility.d.ts +4 -3
- package/build/tests/utilities/uiAssert.utility.js +13 -3
- package/build/tests/utilities/uiAssert.utility.js.map +1 -1
- package/package.json +26 -26
- package/src/__tests__/behavioral/AddingADependency.test.ts +2 -2
- package/src/__tests__/behavioral/UpgradingANodeModule.test.ts +2 -2
- package/src/__tests__/behavioral/events/CreatingAnEvent.test.ts +2 -2
- package/src/__tests__/behavioral/tests/CreatingATest.test.ts +125 -11
- package/src/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.ts +62 -23
- package/src/features/test/actions/CreateAction.ts +83 -28
- package/src/tests/utilities/uiAssert.utility.ts +13 -2
|
@@ -33,7 +33,7 @@ var _AbstractTestTest2 = _interopRequireDefault(require("../../../tests/Abstract
|
|
|
33
33
|
|
|
34
34
|
var _test2 = _interopRequireDefault(require("../../../tests/utilities/test.utility"));
|
|
35
35
|
|
|
36
|
-
var _dec, _dec2, _dec3, _dec4, _class;
|
|
36
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _class;
|
|
37
37
|
|
|
38
38
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
39
39
|
|
|
@@ -53,7 +53,7 @@ var featuresWithRegisteredTests = [{
|
|
|
53
53
|
featureCode: 'view',
|
|
54
54
|
className: 'AbstractViewControllerTest'
|
|
55
55
|
}];
|
|
56
|
-
var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), _dec3 = (0, _test.test)(), _dec4 = (0, _test.test)(), (_class = /*#__PURE__*/function (_AbstractTestTest) {
|
|
56
|
+
var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), _dec3 = (0, _test.test)(), _dec4 = (0, _test.test)(), _dec5 = (0, _test.test)(), (_class = /*#__PURE__*/function (_AbstractTestTest) {
|
|
57
57
|
(0, _inherits2["default"])(SelectingAnAbstractTestClassTest, _AbstractTestTest);
|
|
58
58
|
|
|
59
59
|
var _super = _createSuper(SelectingAnAbstractTestClassTest);
|
|
@@ -67,64 +67,30 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
67
67
|
key: "asksForYouToSelectABaseClass",
|
|
68
68
|
value: function () {
|
|
69
69
|
var _asksForYouToSelectABaseClass = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
var _yield$this$executeCr, choices, promise, _iterator, _step, expected, results;
|
|
70
|
+
var _yield$this$installCo, promise, results;
|
|
73
71
|
|
|
74
72
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
75
73
|
while (1) {
|
|
76
74
|
switch (_context.prev = _context.next) {
|
|
77
75
|
case 0:
|
|
78
76
|
_context.next = 2;
|
|
79
|
-
return this.
|
|
77
|
+
return this.installCopyTestFilesSelectLocalAbstractTest();
|
|
80
78
|
|
|
81
79
|
case 2:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
case 4:
|
|
80
|
+
_yield$this$installCo = _context.sent;
|
|
81
|
+
promise = _yield$this$installCo.promise;
|
|
86
82
|
_context.next = 6;
|
|
87
|
-
return this.executeCreateUntilAbstractClassSelection();
|
|
88
|
-
|
|
89
|
-
case 6:
|
|
90
|
-
_yield$this$executeCr = _context.sent;
|
|
91
|
-
choices = _yield$this$executeCr.choices;
|
|
92
|
-
promise = _yield$this$executeCr.promise;
|
|
93
|
-
_iterator = _createForOfIteratorHelper(expectedAbstractTests);
|
|
94
|
-
|
|
95
|
-
try {
|
|
96
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
97
|
-
expected = _step.value;
|
|
98
|
-
|
|
99
|
-
_test.assert.doesInclude(choices, {
|
|
100
|
-
label: expected
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
} catch (err) {
|
|
104
|
-
_iterator.e(err);
|
|
105
|
-
} finally {
|
|
106
|
-
_iterator.f();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
this.selectOptionBasedOnLabel('AbstractBananaTestDifferentThanFileName');
|
|
110
|
-
_context.next = 14;
|
|
111
83
|
return promise;
|
|
112
84
|
|
|
113
|
-
case
|
|
85
|
+
case 6:
|
|
114
86
|
results = _context.sent;
|
|
115
87
|
|
|
116
88
|
_test2["default"].assertFileByNameInGeneratedFiles('CanBookAppointment.test.ts', results.files);
|
|
117
89
|
|
|
118
|
-
_context.next =
|
|
119
|
-
return this.
|
|
120
|
-
|
|
121
|
-
case 18:
|
|
122
|
-
_context.next = 20;
|
|
123
|
-
return _test.assert.doesThrowAsync(function () {
|
|
124
|
-
return _this.Service('command').execute('yarn test');
|
|
125
|
-
}, /false[\s\S]*?does not equal[\s\S]*?true/gi);
|
|
90
|
+
_context.next = 10;
|
|
91
|
+
return this.buildAndAssertTestFailsAsExpected();
|
|
126
92
|
|
|
127
|
-
case
|
|
93
|
+
case 10:
|
|
128
94
|
case "end":
|
|
129
95
|
return _context.stop();
|
|
130
96
|
}
|
|
@@ -138,27 +104,81 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
138
104
|
|
|
139
105
|
return asksForYouToSelectABaseClass;
|
|
140
106
|
}()
|
|
107
|
+
}, {
|
|
108
|
+
key: "canSelectAbstractClassWhileSelectingSubDir",
|
|
109
|
+
value: function () {
|
|
110
|
+
var _canSelectAbstractClassWhileSelectingSubDir = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
111
|
+
var testDir, _yield$this$invokeCre, promise;
|
|
112
|
+
|
|
113
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
114
|
+
while (1) {
|
|
115
|
+
switch (_context2.prev = _context2.next) {
|
|
116
|
+
case 0:
|
|
117
|
+
testDir = this.resolvePath('src', '__tests__', 'behavioral', 'taco');
|
|
118
|
+
|
|
119
|
+
_spruceSkillUtils.diskUtil.createDir(testDir);
|
|
120
|
+
|
|
121
|
+
_context2.next = 4;
|
|
122
|
+
return this.installAndCopyTestFiles();
|
|
123
|
+
|
|
124
|
+
case 4:
|
|
125
|
+
_context2.next = 6;
|
|
126
|
+
return this.invokeCreateActionAndWaitForInput();
|
|
127
|
+
|
|
128
|
+
case 6:
|
|
129
|
+
_yield$this$invokeCre = _context2.sent;
|
|
130
|
+
promise = _yield$this$invokeCre.promise;
|
|
131
|
+
_context2.next = 10;
|
|
132
|
+
return this.ui.sendInput('taco');
|
|
133
|
+
|
|
134
|
+
case 10:
|
|
135
|
+
_context2.next = 12;
|
|
136
|
+
return this.waitForInput();
|
|
137
|
+
|
|
138
|
+
case 12:
|
|
139
|
+
this.selectOptionBasedOnLabel('AbstractBananaTestDifferentThanFileName');
|
|
140
|
+
_context2.next = 15;
|
|
141
|
+
return promise;
|
|
142
|
+
|
|
143
|
+
case 15:
|
|
144
|
+
_context2.next = 17;
|
|
145
|
+
return this.buildAndAssertTestFailsAsExpected();
|
|
146
|
+
|
|
147
|
+
case 17:
|
|
148
|
+
case "end":
|
|
149
|
+
return _context2.stop();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}, _callee2, this);
|
|
153
|
+
}));
|
|
154
|
+
|
|
155
|
+
function canSelectAbstractClassWhileSelectingSubDir() {
|
|
156
|
+
return _canSelectAbstractClassWhileSelectingSubDir.apply(this, arguments);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return canSelectAbstractClassWhileSelectingSubDir;
|
|
160
|
+
}()
|
|
141
161
|
}, {
|
|
142
162
|
key: "canSelectAbstractTestBasedOnEventEmitter",
|
|
143
163
|
value: function () {
|
|
144
|
-
var _canSelectAbstractTestBasedOnEventEmitter = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
145
|
-
var cli, _yield$this$
|
|
164
|
+
var _canSelectAbstractTestBasedOnEventEmitter = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
165
|
+
var cli, _yield$this$executeCr, choices, promise, results, match, contents;
|
|
146
166
|
|
|
147
|
-
return _regenerator["default"].wrap(function
|
|
167
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
148
168
|
while (1) {
|
|
149
|
-
switch (
|
|
169
|
+
switch (_context4.prev = _context4.next) {
|
|
150
170
|
case 0:
|
|
151
|
-
|
|
171
|
+
_context4.next = 2;
|
|
152
172
|
return this.installTests();
|
|
153
173
|
|
|
154
174
|
case 2:
|
|
155
|
-
cli =
|
|
156
|
-
void cli.on('test.register-abstract-test-classes', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
157
|
-
return _regenerator["default"].wrap(function
|
|
175
|
+
cli = _context4.sent;
|
|
176
|
+
void cli.on('test.register-abstract-test-classes', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
177
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
158
178
|
while (1) {
|
|
159
|
-
switch (
|
|
179
|
+
switch (_context3.prev = _context3.next) {
|
|
160
180
|
case 0:
|
|
161
|
-
return
|
|
181
|
+
return _context3.abrupt("return", {
|
|
162
182
|
abstractClasses: [{
|
|
163
183
|
name: 'TestClass',
|
|
164
184
|
label: 'TestClass',
|
|
@@ -172,18 +192,18 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
172
192
|
|
|
173
193
|
case 1:
|
|
174
194
|
case "end":
|
|
175
|
-
return
|
|
195
|
+
return _context3.stop();
|
|
176
196
|
}
|
|
177
197
|
}
|
|
178
|
-
},
|
|
198
|
+
}, _callee3);
|
|
179
199
|
})));
|
|
180
|
-
|
|
200
|
+
_context4.next = 6;
|
|
181
201
|
return this.executeCreateUntilAbstractClassSelection();
|
|
182
202
|
|
|
183
203
|
case 6:
|
|
184
|
-
_yield$this$
|
|
185
|
-
choices = _yield$this$
|
|
186
|
-
promise = _yield$this$
|
|
204
|
+
_yield$this$executeCr = _context4.sent;
|
|
205
|
+
choices = _yield$this$executeCr.choices;
|
|
206
|
+
promise = _yield$this$executeCr.promise;
|
|
187
207
|
|
|
188
208
|
_test.assert.doesInclude(choices, {
|
|
189
209
|
label: 'TestClass'
|
|
@@ -194,11 +214,11 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
194
214
|
});
|
|
195
215
|
|
|
196
216
|
this.selectOptionBasedOnLabel('TestClass2');
|
|
197
|
-
|
|
217
|
+
_context4.next = 14;
|
|
198
218
|
return promise;
|
|
199
219
|
|
|
200
220
|
case 14:
|
|
201
|
-
results =
|
|
221
|
+
results = _context4.sent;
|
|
202
222
|
|
|
203
223
|
_test.assert.isFalsy(results.errors);
|
|
204
224
|
|
|
@@ -211,10 +231,10 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
211
231
|
|
|
212
232
|
case 20:
|
|
213
233
|
case "end":
|
|
214
|
-
return
|
|
234
|
+
return _context4.stop();
|
|
215
235
|
}
|
|
216
236
|
}
|
|
217
|
-
},
|
|
237
|
+
}, _callee4, this);
|
|
218
238
|
}));
|
|
219
239
|
|
|
220
240
|
function canSelectAbstractTestBasedOnEventEmitter() {
|
|
@@ -226,35 +246,35 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
226
246
|
}, {
|
|
227
247
|
key: "installingAFeatureRemovesLabelFromName",
|
|
228
248
|
value: function () {
|
|
229
|
-
var _installingAFeatureRemovesLabelFromName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
230
|
-
var
|
|
249
|
+
var _installingAFeatureRemovesLabelFromName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
250
|
+
var _this = this;
|
|
231
251
|
|
|
232
|
-
var testFeature,
|
|
252
|
+
var testFeature, _iterator, _step, _loop;
|
|
233
253
|
|
|
234
|
-
return _regenerator["default"].wrap(function
|
|
254
|
+
return _regenerator["default"].wrap(function _callee5$(_context6) {
|
|
235
255
|
while (1) {
|
|
236
|
-
switch (
|
|
256
|
+
switch (_context6.prev = _context6.next) {
|
|
237
257
|
case 0:
|
|
238
258
|
_CommandService["default"].setMockResponse(new RegExp(/npm[\s\S]*?install [\s\S]*?/gi), {
|
|
239
259
|
code: 0
|
|
240
260
|
});
|
|
241
261
|
|
|
242
|
-
|
|
262
|
+
_context6.next = 3;
|
|
243
263
|
return this.installTests();
|
|
244
264
|
|
|
245
265
|
case 3:
|
|
246
266
|
testFeature = this.getFeatureInstaller().getFeature('test');
|
|
247
|
-
|
|
248
|
-
|
|
267
|
+
_iterator = _createForOfIteratorHelper(featuresWithRegisteredTests);
|
|
268
|
+
_context6.prev = 5;
|
|
249
269
|
_loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
|
|
250
270
|
var feat, candidates;
|
|
251
|
-
return _regenerator["default"].wrap(function _loop$(
|
|
271
|
+
return _regenerator["default"].wrap(function _loop$(_context5) {
|
|
252
272
|
while (1) {
|
|
253
|
-
switch (
|
|
273
|
+
switch (_context5.prev = _context5.next) {
|
|
254
274
|
case 0:
|
|
255
|
-
feat =
|
|
256
|
-
|
|
257
|
-
return
|
|
275
|
+
feat = _step.value;
|
|
276
|
+
_context5.next = 3;
|
|
277
|
+
return _this.getFeatureInstaller().install({
|
|
258
278
|
features: [{
|
|
259
279
|
//@ts-ignore
|
|
260
280
|
code: feat.featureCode
|
|
@@ -262,11 +282,11 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
262
282
|
});
|
|
263
283
|
|
|
264
284
|
case 3:
|
|
265
|
-
|
|
285
|
+
_context5.next = 5;
|
|
266
286
|
return testFeature.buildParentClassCandidates();
|
|
267
287
|
|
|
268
288
|
case 5:
|
|
269
|
-
candidates =
|
|
289
|
+
candidates = _context5.sent;
|
|
270
290
|
|
|
271
291
|
_test.assert.isTruthy(candidates.find(function (_ref2) {
|
|
272
292
|
var name = _ref2.name;
|
|
@@ -275,49 +295,49 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
275
295
|
|
|
276
296
|
case 7:
|
|
277
297
|
case "end":
|
|
278
|
-
return
|
|
298
|
+
return _context5.stop();
|
|
279
299
|
}
|
|
280
300
|
}
|
|
281
301
|
}, _loop);
|
|
282
302
|
});
|
|
283
303
|
|
|
284
|
-
|
|
304
|
+
_iterator.s();
|
|
285
305
|
|
|
286
306
|
case 8:
|
|
287
|
-
if ((
|
|
288
|
-
|
|
307
|
+
if ((_step = _iterator.n()).done) {
|
|
308
|
+
_context6.next = 12;
|
|
289
309
|
break;
|
|
290
310
|
}
|
|
291
311
|
|
|
292
|
-
return
|
|
312
|
+
return _context6.delegateYield(_loop(), "t0", 10);
|
|
293
313
|
|
|
294
314
|
case 10:
|
|
295
|
-
|
|
315
|
+
_context6.next = 8;
|
|
296
316
|
break;
|
|
297
317
|
|
|
298
318
|
case 12:
|
|
299
|
-
|
|
319
|
+
_context6.next = 17;
|
|
300
320
|
break;
|
|
301
321
|
|
|
302
322
|
case 14:
|
|
303
|
-
|
|
304
|
-
|
|
323
|
+
_context6.prev = 14;
|
|
324
|
+
_context6.t1 = _context6["catch"](5);
|
|
305
325
|
|
|
306
|
-
|
|
326
|
+
_iterator.e(_context6.t1);
|
|
307
327
|
|
|
308
328
|
case 17:
|
|
309
|
-
|
|
329
|
+
_context6.prev = 17;
|
|
310
330
|
|
|
311
|
-
|
|
331
|
+
_iterator.f();
|
|
312
332
|
|
|
313
|
-
return
|
|
333
|
+
return _context6.finish(17);
|
|
314
334
|
|
|
315
335
|
case 20:
|
|
316
336
|
case "end":
|
|
317
|
-
return
|
|
337
|
+
return _context6.stop();
|
|
318
338
|
}
|
|
319
339
|
}
|
|
320
|
-
},
|
|
340
|
+
}, _callee5, this, [[5, 14, 17, 20]]);
|
|
321
341
|
}));
|
|
322
342
|
|
|
323
343
|
function installingAFeatureRemovesLabelFromName() {
|
|
@@ -329,116 +349,116 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
329
349
|
}, {
|
|
330
350
|
key: "selectingUninistalledTestInstallsTheFeature",
|
|
331
351
|
value: function () {
|
|
332
|
-
var _selectingUninistalledTestInstallsTheFeature = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
333
|
-
var
|
|
352
|
+
var _selectingUninistalledTestInstallsTheFeature = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
353
|
+
var _this2 = this;
|
|
334
354
|
|
|
335
|
-
var
|
|
355
|
+
var _iterator2, _step2, _loop2;
|
|
336
356
|
|
|
337
|
-
return _regenerator["default"].wrap(function
|
|
357
|
+
return _regenerator["default"].wrap(function _callee6$(_context8) {
|
|
338
358
|
while (1) {
|
|
339
|
-
switch (
|
|
359
|
+
switch (_context8.prev = _context8.next) {
|
|
340
360
|
case 0:
|
|
341
361
|
_CommandService["default"].setMockResponse(new RegExp(/npm[\s\S]*?install [\s\S]*?/gi), {
|
|
342
362
|
code: 0
|
|
343
363
|
});
|
|
344
364
|
|
|
345
|
-
|
|
346
|
-
|
|
365
|
+
_iterator2 = _createForOfIteratorHelper(featuresWithRegisteredTests);
|
|
366
|
+
_context8.prev = 2;
|
|
347
367
|
_loop2 = /*#__PURE__*/_regenerator["default"].mark(function _loop2() {
|
|
348
|
-
var feat, _yield$
|
|
368
|
+
var feat, _yield$_this2$execute, choices, promise, match, isInstalled;
|
|
349
369
|
|
|
350
|
-
return _regenerator["default"].wrap(function _loop2$(
|
|
370
|
+
return _regenerator["default"].wrap(function _loop2$(_context7) {
|
|
351
371
|
while (1) {
|
|
352
|
-
switch (
|
|
372
|
+
switch (_context7.prev = _context7.next) {
|
|
353
373
|
case 0:
|
|
354
|
-
feat =
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
return
|
|
374
|
+
feat = _step2.value;
|
|
375
|
+
_this2.cwd = _spruceSkillUtils.diskUtil.createRandomTempDir();
|
|
376
|
+
_context7.next = 4;
|
|
377
|
+
return _this2.installTests();
|
|
358
378
|
|
|
359
379
|
case 4:
|
|
360
|
-
|
|
361
|
-
return
|
|
380
|
+
_context7.next = 6;
|
|
381
|
+
return _this2.executeCreateUntilAbstractClassSelection();
|
|
362
382
|
|
|
363
383
|
case 6:
|
|
364
|
-
_yield$
|
|
365
|
-
choices = _yield$
|
|
366
|
-
promise = _yield$
|
|
384
|
+
_yield$_this2$execute = _context7.sent;
|
|
385
|
+
choices = _yield$_this2$execute.choices;
|
|
386
|
+
promise = _yield$_this2$execute.promise;
|
|
367
387
|
match = choices.find(function (c) {
|
|
368
388
|
return c.label.includes(feat.className);
|
|
369
389
|
});
|
|
370
390
|
|
|
371
391
|
_test.assert.isTruthy(match);
|
|
372
392
|
|
|
373
|
-
|
|
374
|
-
return
|
|
393
|
+
_context7.next = 13;
|
|
394
|
+
return _this2.getFeatureInstaller().isInstalled(feat.featureCode);
|
|
375
395
|
|
|
376
396
|
case 13:
|
|
377
|
-
isInstalled =
|
|
397
|
+
isInstalled = _context7.sent;
|
|
378
398
|
|
|
379
399
|
_test.assert.isFalse(isInstalled);
|
|
380
400
|
|
|
381
|
-
|
|
382
|
-
return
|
|
401
|
+
_context7.next = 17;
|
|
402
|
+
return _this2.ui.sendInput(match === null || match === void 0 ? void 0 : match.value);
|
|
383
403
|
|
|
384
404
|
case 17:
|
|
385
|
-
|
|
405
|
+
_context7.next = 19;
|
|
386
406
|
return promise;
|
|
387
407
|
|
|
388
408
|
case 19:
|
|
389
|
-
|
|
390
|
-
return
|
|
409
|
+
_context7.next = 21;
|
|
410
|
+
return _this2.getFeatureInstaller().isInstalled(feat.featureCode);
|
|
391
411
|
|
|
392
412
|
case 21:
|
|
393
|
-
isInstalled =
|
|
413
|
+
isInstalled = _context7.sent;
|
|
394
414
|
|
|
395
415
|
_test.assert.isTrue(isInstalled);
|
|
396
416
|
|
|
397
417
|
case 23:
|
|
398
418
|
case "end":
|
|
399
|
-
return
|
|
419
|
+
return _context7.stop();
|
|
400
420
|
}
|
|
401
421
|
}
|
|
402
422
|
}, _loop2);
|
|
403
423
|
});
|
|
404
424
|
|
|
405
|
-
|
|
425
|
+
_iterator2.s();
|
|
406
426
|
|
|
407
427
|
case 5:
|
|
408
|
-
if ((
|
|
409
|
-
|
|
428
|
+
if ((_step2 = _iterator2.n()).done) {
|
|
429
|
+
_context8.next = 9;
|
|
410
430
|
break;
|
|
411
431
|
}
|
|
412
432
|
|
|
413
|
-
return
|
|
433
|
+
return _context8.delegateYield(_loop2(), "t0", 7);
|
|
414
434
|
|
|
415
435
|
case 7:
|
|
416
|
-
|
|
436
|
+
_context8.next = 5;
|
|
417
437
|
break;
|
|
418
438
|
|
|
419
439
|
case 9:
|
|
420
|
-
|
|
440
|
+
_context8.next = 14;
|
|
421
441
|
break;
|
|
422
442
|
|
|
423
443
|
case 11:
|
|
424
|
-
|
|
425
|
-
|
|
444
|
+
_context8.prev = 11;
|
|
445
|
+
_context8.t1 = _context8["catch"](2);
|
|
426
446
|
|
|
427
|
-
|
|
447
|
+
_iterator2.e(_context8.t1);
|
|
428
448
|
|
|
429
449
|
case 14:
|
|
430
|
-
|
|
450
|
+
_context8.prev = 14;
|
|
431
451
|
|
|
432
|
-
|
|
452
|
+
_iterator2.f();
|
|
433
453
|
|
|
434
|
-
return
|
|
454
|
+
return _context8.finish(14);
|
|
435
455
|
|
|
436
456
|
case 17:
|
|
437
457
|
case "end":
|
|
438
|
-
return
|
|
458
|
+
return _context8.stop();
|
|
439
459
|
}
|
|
440
460
|
}
|
|
441
|
-
},
|
|
461
|
+
}, _callee6, null, [[2, 11, 14, 17]]);
|
|
442
462
|
}));
|
|
443
463
|
|
|
444
464
|
function selectingUninistalledTestInstallsTheFeature() {
|
|
@@ -447,26 +467,144 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
447
467
|
|
|
448
468
|
return selectingUninistalledTestInstallsTheFeature;
|
|
449
469
|
}()
|
|
470
|
+
}, {
|
|
471
|
+
key: "buildAndAssertTestFailsAsExpected",
|
|
472
|
+
value: function () {
|
|
473
|
+
var _buildAndAssertTestFailsAsExpected = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
474
|
+
var _this3 = this;
|
|
475
|
+
|
|
476
|
+
return _regenerator["default"].wrap(function _callee7$(_context9) {
|
|
477
|
+
while (1) {
|
|
478
|
+
switch (_context9.prev = _context9.next) {
|
|
479
|
+
case 0:
|
|
480
|
+
_context9.next = 2;
|
|
481
|
+
return this.Service('build').build();
|
|
482
|
+
|
|
483
|
+
case 2:
|
|
484
|
+
_context9.next = 4;
|
|
485
|
+
return _test.assert.doesThrowAsync(function () {
|
|
486
|
+
return _this3.Service('command').execute('yarn test');
|
|
487
|
+
}, /false[\s\S]*?does not equal[\s\S]*?true/gi);
|
|
488
|
+
|
|
489
|
+
case 4:
|
|
490
|
+
case "end":
|
|
491
|
+
return _context9.stop();
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}, _callee7, this);
|
|
495
|
+
}));
|
|
496
|
+
|
|
497
|
+
function buildAndAssertTestFailsAsExpected() {
|
|
498
|
+
return _buildAndAssertTestFailsAsExpected.apply(this, arguments);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
return buildAndAssertTestFailsAsExpected;
|
|
502
|
+
}()
|
|
503
|
+
}, {
|
|
504
|
+
key: "installCopyTestFilesSelectLocalAbstractTest",
|
|
505
|
+
value: function () {
|
|
506
|
+
var _installCopyTestFilesSelectLocalAbstractTest = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
507
|
+
var _yield$this$executeCr2, choices, promise, _iterator3, _step3, expected;
|
|
508
|
+
|
|
509
|
+
return _regenerator["default"].wrap(function _callee8$(_context10) {
|
|
510
|
+
while (1) {
|
|
511
|
+
switch (_context10.prev = _context10.next) {
|
|
512
|
+
case 0:
|
|
513
|
+
_context10.next = 2;
|
|
514
|
+
return this.installAndCopyTestFiles();
|
|
515
|
+
|
|
516
|
+
case 2:
|
|
517
|
+
_context10.next = 4;
|
|
518
|
+
return this.executeCreateUntilAbstractClassSelection();
|
|
519
|
+
|
|
520
|
+
case 4:
|
|
521
|
+
_yield$this$executeCr2 = _context10.sent;
|
|
522
|
+
choices = _yield$this$executeCr2.choices;
|
|
523
|
+
promise = _yield$this$executeCr2.promise;
|
|
524
|
+
_iterator3 = _createForOfIteratorHelper(expectedAbstractTests);
|
|
525
|
+
|
|
526
|
+
try {
|
|
527
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
528
|
+
expected = _step3.value;
|
|
529
|
+
|
|
530
|
+
_test.assert.doesInclude(choices, {
|
|
531
|
+
label: expected
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
} catch (err) {
|
|
535
|
+
_iterator3.e(err);
|
|
536
|
+
} finally {
|
|
537
|
+
_iterator3.f();
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
this.selectOptionBasedOnLabel('AbstractBananaTestDifferentThanFileName');
|
|
541
|
+
return _context10.abrupt("return", {
|
|
542
|
+
promise: promise
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
case 11:
|
|
546
|
+
case "end":
|
|
547
|
+
return _context10.stop();
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}, _callee8, this);
|
|
551
|
+
}));
|
|
552
|
+
|
|
553
|
+
function installCopyTestFilesSelectLocalAbstractTest() {
|
|
554
|
+
return _installCopyTestFilesSelectLocalAbstractTest.apply(this, arguments);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
return installCopyTestFilesSelectLocalAbstractTest;
|
|
558
|
+
}()
|
|
559
|
+
}, {
|
|
560
|
+
key: "installAndCopyTestFiles",
|
|
561
|
+
value: function () {
|
|
562
|
+
var _installAndCopyTestFiles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
|
563
|
+
return _regenerator["default"].wrap(function _callee9$(_context11) {
|
|
564
|
+
while (1) {
|
|
565
|
+
switch (_context11.prev = _context11.next) {
|
|
566
|
+
case 0:
|
|
567
|
+
_context11.next = 2;
|
|
568
|
+
return this.installTests();
|
|
569
|
+
|
|
570
|
+
case 2:
|
|
571
|
+
_context11.next = 4;
|
|
572
|
+
return this.copyTestFiles();
|
|
573
|
+
|
|
574
|
+
case 4:
|
|
575
|
+
case "end":
|
|
576
|
+
return _context11.stop();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}, _callee9, this);
|
|
580
|
+
}));
|
|
581
|
+
|
|
582
|
+
function installAndCopyTestFiles() {
|
|
583
|
+
return _installAndCopyTestFiles.apply(this, arguments);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
return installAndCopyTestFiles;
|
|
587
|
+
}()
|
|
450
588
|
}, {
|
|
451
589
|
key: "copyTestFiles",
|
|
452
590
|
value: function () {
|
|
453
|
-
var _copyTestFiles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
591
|
+
var _copyTestFiles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
|
|
454
592
|
var source, destination;
|
|
455
|
-
return _regenerator["default"].wrap(function
|
|
593
|
+
return _regenerator["default"].wrap(function _callee10$(_context12) {
|
|
456
594
|
while (1) {
|
|
457
|
-
switch (
|
|
595
|
+
switch (_context12.prev = _context12.next) {
|
|
458
596
|
case 0:
|
|
459
597
|
source = this.resolveTestPath('abstract_tests');
|
|
460
598
|
destination = this.resolvePath('src');
|
|
461
|
-
|
|
599
|
+
_context12.next = 4;
|
|
462
600
|
return _spruceSkillUtils.diskUtil.copyDir(source, destination);
|
|
463
601
|
|
|
464
602
|
case 4:
|
|
465
603
|
case "end":
|
|
466
|
-
return
|
|
604
|
+
return _context12.stop();
|
|
467
605
|
}
|
|
468
606
|
}
|
|
469
|
-
},
|
|
607
|
+
}, _callee10, this);
|
|
470
608
|
}));
|
|
471
609
|
|
|
472
610
|
function copyTestFiles() {
|
|
@@ -478,37 +616,34 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
478
616
|
}, {
|
|
479
617
|
key: "executeCreateUntilAbstractClassSelection",
|
|
480
618
|
value: function () {
|
|
481
|
-
var _executeCreateUntilAbstractClassSelection = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
619
|
+
var _executeCreateUntilAbstractClassSelection = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
|
|
482
620
|
var _last$options$options;
|
|
483
621
|
|
|
484
|
-
var promise, last, _ref3, choices;
|
|
622
|
+
var _yield$this$invokeCre2, promise, last, _ref3, choices;
|
|
485
623
|
|
|
486
|
-
return _regenerator["default"].wrap(function
|
|
624
|
+
return _regenerator["default"].wrap(function _callee11$(_context13) {
|
|
487
625
|
while (1) {
|
|
488
|
-
switch (
|
|
626
|
+
switch (_context13.prev = _context13.next) {
|
|
489
627
|
case 0:
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
nameReadable: 'Can book appointment',
|
|
493
|
-
nameCamel: 'canBookAppointment'
|
|
494
|
-
});
|
|
495
|
-
_context9.next = 3;
|
|
496
|
-
return this.waitForInput();
|
|
628
|
+
_context13.next = 2;
|
|
629
|
+
return this.invokeCreateActionAndWaitForInput();
|
|
497
630
|
|
|
498
|
-
case
|
|
631
|
+
case 2:
|
|
632
|
+
_yield$this$invokeCre2 = _context13.sent;
|
|
633
|
+
promise = _yield$this$invokeCre2.promise;
|
|
499
634
|
last = this.ui.getLastInvocation();
|
|
500
635
|
_ref3 = (_last$options$options = last.options.options) !== null && _last$options$options !== void 0 ? _last$options$options : {}, choices = _ref3.choices;
|
|
501
|
-
return
|
|
636
|
+
return _context13.abrupt("return", {
|
|
502
637
|
promise: promise,
|
|
503
638
|
choices: choices
|
|
504
639
|
});
|
|
505
640
|
|
|
506
|
-
case
|
|
641
|
+
case 7:
|
|
507
642
|
case "end":
|
|
508
|
-
return
|
|
643
|
+
return _context13.stop();
|
|
509
644
|
}
|
|
510
645
|
}
|
|
511
|
-
},
|
|
646
|
+
}, _callee11, this);
|
|
512
647
|
}));
|
|
513
648
|
|
|
514
649
|
function executeCreateUntilAbstractClassSelection() {
|
|
@@ -517,8 +652,44 @@ var SelectingAnAbstractTestClassTest = (_dec = (0, _test.test)(), _dec2 = (0, _t
|
|
|
517
652
|
|
|
518
653
|
return executeCreateUntilAbstractClassSelection;
|
|
519
654
|
}()
|
|
655
|
+
}, {
|
|
656
|
+
key: "invokeCreateActionAndWaitForInput",
|
|
657
|
+
value: function () {
|
|
658
|
+
var _invokeCreateActionAndWaitForInput = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {
|
|
659
|
+
var promise;
|
|
660
|
+
return _regenerator["default"].wrap(function _callee12$(_context14) {
|
|
661
|
+
while (1) {
|
|
662
|
+
switch (_context14.prev = _context14.next) {
|
|
663
|
+
case 0:
|
|
664
|
+
promise = this.Action('test', 'create').execute({
|
|
665
|
+
type: 'behavioral',
|
|
666
|
+
nameReadable: 'Can book appointment',
|
|
667
|
+
nameCamel: 'canBookAppointment'
|
|
668
|
+
});
|
|
669
|
+
_context14.next = 3;
|
|
670
|
+
return this.waitForInput();
|
|
671
|
+
|
|
672
|
+
case 3:
|
|
673
|
+
return _context14.abrupt("return", {
|
|
674
|
+
promise: promise
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
case 4:
|
|
678
|
+
case "end":
|
|
679
|
+
return _context14.stop();
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}, _callee12, this);
|
|
683
|
+
}));
|
|
684
|
+
|
|
685
|
+
function invokeCreateActionAndWaitForInput() {
|
|
686
|
+
return _invokeCreateActionAndWaitForInput.apply(this, arguments);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
return invokeCreateActionAndWaitForInput;
|
|
690
|
+
}()
|
|
520
691
|
}]);
|
|
521
692
|
return SelectingAnAbstractTestClassTest;
|
|
522
|
-
}(_AbstractTestTest2["default"]), ((0, _applyDecoratedDescriptor2["default"])(_class, "asksForYouToSelectABaseClass", [_dec], Object.getOwnPropertyDescriptor(_class, "asksForYouToSelectABaseClass"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "
|
|
693
|
+
}(_AbstractTestTest2["default"]), ((0, _applyDecoratedDescriptor2["default"])(_class, "asksForYouToSelectABaseClass", [_dec], Object.getOwnPropertyDescriptor(_class, "asksForYouToSelectABaseClass"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "canSelectAbstractClassWhileSelectingSubDir", [_dec2], Object.getOwnPropertyDescriptor(_class, "canSelectAbstractClassWhileSelectingSubDir"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "canSelectAbstractTestBasedOnEventEmitter", [_dec3], Object.getOwnPropertyDescriptor(_class, "canSelectAbstractTestBasedOnEventEmitter"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "installingAFeatureRemovesLabelFromName", [_dec4], Object.getOwnPropertyDescriptor(_class, "installingAFeatureRemovesLabelFromName"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "selectingUninistalledTestInstallsTheFeature", [_dec5], Object.getOwnPropertyDescriptor(_class, "selectingUninistalledTestInstallsTheFeature"), _class)), _class));
|
|
523
694
|
exports["default"] = SelectingAnAbstractTestClassTest;
|
|
524
695
|
//# sourceMappingURL=SelectingAnAbstractTestClass.test.js.map
|