@sprucelabs/spruce-cli 14.28.7 → 14.29.2

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.
Files changed (128) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/build/__tests__/behavioral/SettingLogTransportsInASkill.test.js +13 -9
  3. package/build/__tests__/behavioral/SettingLogTransportsInASkill.test.js.map +1 -1
  4. package/build/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.d.ts +1 -1
  5. package/build/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.js +24 -14
  6. package/build/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.js.map +1 -1
  7. package/build/__tests__/behavioral/TestingDataStores.test.js +15 -11
  8. package/build/__tests__/behavioral/TestingDataStores.test.js.map +1 -1
  9. package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js +3 -1
  10. package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js.map +1 -1
  11. package/build/__tests__/behavioral/events/CreatingAListener.test.d.ts +2 -0
  12. package/build/__tests__/behavioral/events/CreatingAListener.test.js +157 -81
  13. package/build/__tests__/behavioral/events/CreatingAListener.test.js.map +1 -1
  14. package/build/__tests__/behavioral/events/KeepingListenersInSync.test.d.ts +7 -0
  15. package/build/__tests__/behavioral/events/KeepingListenersInSync.test.js +171 -0
  16. package/build/__tests__/behavioral/events/KeepingListenersInSync.test.js.map +1 -0
  17. package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.d.ts +1 -0
  18. package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js +53 -21
  19. package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js.map +1 -1
  20. package/build/__tests__/behavioral/skill/UpgradingWithListeners.test.d.ts +5 -0
  21. package/build/__tests__/behavioral/skill/UpgradingWithListeners.test.js +137 -0
  22. package/build/__tests__/behavioral/skill/UpgradingWithListeners.test.js.map +1 -0
  23. package/build/__tests__/behavioral/stores/CreatingADataStore.test.js +4 -1
  24. package/build/__tests__/behavioral/stores/CreatingADataStore.test.js.map +1 -1
  25. package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.d.ts +4 -1
  26. package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.js +136 -47
  27. package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.js.map +1 -1
  28. package/build/__tests__/behavioral/tests/CreatingATest.test.js +14 -10
  29. package/build/__tests__/behavioral/tests/CreatingATest.test.js.map +1 -1
  30. package/build/__tests__/behavioral/views/TestingViewControllers.test.d.ts +1 -0
  31. package/build/__tests__/behavioral/views/TestingViewControllers.test.js +67 -35
  32. package/build/__tests__/behavioral/views/TestingViewControllers.test.js.map +1 -1
  33. package/build/__tests__/implementation/AuthService.test.d.ts +1 -0
  34. package/build/__tests__/implementation/AuthService.test.js +8 -0
  35. package/build/__tests__/implementation/AuthService.test.js.map +1 -1
  36. package/build/__tests__/implementation/EventStore.test.js +3 -1
  37. package/build/__tests__/implementation/EventStore.test.js.map +1 -1
  38. package/build/__tests__/implementation/LintService.test.d.ts +5 -0
  39. package/build/__tests__/implementation/LintService.test.js +130 -0
  40. package/build/__tests__/implementation/LintService.test.js.map +1 -0
  41. package/build/__tests__/implementation/StoreFeature.test.d.ts +4 -0
  42. package/build/__tests__/implementation/StoreFeature.test.js +132 -0
  43. package/build/__tests__/implementation/StoreFeature.test.js.map +1 -0
  44. package/build/errors/SpruceError.js +8 -4
  45. package/build/errors/SpruceError.js.map +1 -1
  46. package/build/features/event/EventFeature.d.ts +2 -2
  47. package/build/features/event/EventFeature.js +53 -13
  48. package/build/features/event/EventFeature.js.map +1 -1
  49. package/build/features/event/actions/ListenAction.d.ts +1 -0
  50. package/build/features/event/actions/ListenAction.js +60 -31
  51. package/build/features/event/actions/ListenAction.js.map +1 -1
  52. package/build/features/event/actions/SyncListenersAction.d.ts +15 -0
  53. package/build/features/event/actions/SyncListenersAction.js +115 -0
  54. package/build/features/event/actions/SyncListenersAction.js.map +1 -0
  55. package/build/features/event/builders/ListenerTemplateItemBuilder.d.ts +8 -0
  56. package/build/features/event/builders/ListenerTemplateItemBuilder.js +65 -0
  57. package/build/features/event/builders/ListenerTemplateItemBuilder.js.map +1 -0
  58. package/build/features/event/stores/EventStore.js +2 -2
  59. package/build/features/event/stores/EventStore.js.map +1 -1
  60. package/build/features/event/stores/ListenerStore.d.ts +9 -0
  61. package/build/features/event/stores/ListenerStore.js +122 -0
  62. package/build/features/event/stores/ListenerStore.js.map +1 -0
  63. package/build/features/event/writers/EventWriter.d.ts +4 -1
  64. package/build/features/event/writers/EventWriter.js +42 -8
  65. package/build/features/event/writers/EventWriter.js.map +1 -1
  66. package/build/features/node/NodeFeature.js +1 -1
  67. package/build/features/node/NodeFeature.js.map +1 -1
  68. package/build/features/skill/SkillFeature.js +1 -1
  69. package/build/features/skill/SkillFeature.js.map +1 -1
  70. package/build/features/skill/stores/SkillStore.js +4 -8
  71. package/build/features/skill/stores/SkillStore.js.map +1 -1
  72. package/build/features/store/StoreFeature.d.ts +1 -1
  73. package/build/features/store/StoreFeature.js +16 -11
  74. package/build/features/store/StoreFeature.js.map +1 -1
  75. package/build/services/AuthService.d.ts +4 -1
  76. package/build/services/AuthService.js +15 -4
  77. package/build/services/AuthService.js.map +1 -1
  78. package/build/services/GameService.js +14 -10
  79. package/build/services/GameService.js.map +1 -1
  80. package/build/services/LintService.d.ts +5 -2
  81. package/build/services/LintService.js +137 -92
  82. package/build/services/LintService.js.map +1 -1
  83. package/build/services/ServiceFactory.js +9 -3
  84. package/build/services/ServiceFactory.js.map +1 -1
  85. package/build/stores/StoreFactory.d.ts +2 -0
  86. package/build/stores/StoreFactory.js +4 -1
  87. package/build/stores/StoreFactory.js.map +1 -1
  88. package/build/tests/AbstractCliTest.js +3 -3
  89. package/build/tests/AbstractCliTest.js.map +1 -1
  90. package/build/writers/AbstractWriter.d.ts +0 -3
  91. package/build/writers/AbstractWriter.js +2 -18
  92. package/build/writers/AbstractWriter.js.map +1 -1
  93. package/package.json +11 -9
  94. package/src/__tests__/behavioral/SettingLogTransportsInASkill.test.ts +2 -0
  95. package/src/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.ts +10 -5
  96. package/src/__tests__/behavioral/TestingDataStores.test.ts +2 -0
  97. package/src/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.ts +1 -0
  98. package/src/__tests__/behavioral/events/CreatingAListener.test.ts +28 -9
  99. package/src/__tests__/behavioral/events/KeepingListenersInSync.test.ts +47 -0
  100. package/src/__tests__/behavioral/events/SkillEmitsBootEvents.test.ts +6 -0
  101. package/src/__tests__/behavioral/skill/UpgradingWithListeners.test.ts +59 -0
  102. package/src/__tests__/behavioral/stores/CreatingADataStore.test.ts +1 -0
  103. package/src/__tests__/behavioral/stores/KeepingDataStoresInSync.test.ts +35 -6
  104. package/src/__tests__/behavioral/tests/CreatingATest.test.ts +2 -0
  105. package/src/__tests__/behavioral/views/TestingViewControllers.test.ts +6 -0
  106. package/src/__tests__/implementation/AuthService.test.ts +6 -0
  107. package/src/__tests__/implementation/EventStore.test.ts +1 -0
  108. package/src/__tests__/implementation/LintService.test.ts +34 -0
  109. package/src/__tests__/implementation/StoreFeature.test.ts +40 -0
  110. package/src/errors/SpruceError.ts +9 -5
  111. package/src/features/event/EventFeature.ts +21 -4
  112. package/src/features/event/actions/ListenAction.ts +9 -3
  113. package/src/features/event/actions/SyncListenersAction.ts +38 -0
  114. package/src/features/event/builders/ListenerTemplateItemBuilder.ts +27 -0
  115. package/src/features/event/stores/EventStore.ts +1 -1
  116. package/src/features/event/stores/ListenerStore.ts +32 -0
  117. package/src/features/event/writers/EventWriter.ts +19 -0
  118. package/src/features/node/NodeFeature.ts +2 -1
  119. package/src/features/skill/SkillFeature.ts +1 -1
  120. package/src/features/skill/stores/SkillStore.ts +4 -3
  121. package/src/features/store/StoreFeature.ts +7 -4
  122. package/src/services/AuthService.ts +15 -5
  123. package/src/services/GameService.ts +1 -0
  124. package/src/services/LintService.ts +34 -5
  125. package/src/services/ServiceFactory.ts +8 -3
  126. package/src/stores/StoreFactory.ts +3 -0
  127. package/src/tests/AbstractCliTest.ts +2 -2
  128. package/src/writers/AbstractWriter.ts +2 -13
@@ -37,13 +37,13 @@ var _AbstractSkillTest2 = _interopRequireDefault(require("../../../tests/Abstrac
37
37
 
38
38
  var _test2 = _interopRequireDefault(require("../../../tests/utilities/test.utility"));
39
39
 
40
- var _dec, _dec2, _dec3, _dec4, _class, _class2, _temp;
40
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _temp;
41
41
 
42
42
  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); }; }
43
43
 
44
44
  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; } }
45
45
 
46
- var KeepingDataStoresInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), _dec3 = (0, _test.test)(), _dec4 = (0, _test.test)(), (_class = (_temp = _class2 = /*#__PURE__*/function (_AbstractSkillTest) {
46
+ var KeepingDataStoresInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), _dec3 = (0, _test.test)(), _dec4 = (0, _test.test)(), _dec5 = (0, _test.test)(), _dec6 = (0, _test.test)(), (_class = (_temp = _class2 = /*#__PURE__*/function (_AbstractSkillTest) {
47
47
  (0, _inherits2["default"])(KeepingDataStoresInSyncTest, _AbstractSkillTest);
48
48
 
49
49
  var _super = _createSuper(KeepingDataStoresInSyncTest);
@@ -165,16 +165,31 @@ var KeepingDataStoresInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
165
165
  return syncsNothingToStart;
166
166
  }()
167
167
  }, {
168
- key: "syncStores",
168
+ key: "badFileReturnsError",
169
169
  value: function () {
170
- var _syncStores = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
170
+ var _badFileReturnsError = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
171
+ var results;
171
172
  return _regenerator["default"].wrap(function _callee5$(_context5) {
172
173
  while (1) {
173
174
  switch (_context5.prev = _context5.next) {
174
175
  case 0:
175
- return _context5.abrupt("return", this.Action('store', 'sync').execute({}));
176
+ _spruceSkillUtils.diskUtil.writeFile(this.badStoreDest, 'throw new Error("Cheese!")');
176
177
 
177
- case 1:
178
+ _context5.next = 3;
179
+ return this.syncStores();
180
+
181
+ case 3:
182
+ results = _context5.sent;
183
+
184
+ _test.assert.isArray(results.errors);
185
+
186
+ _test.assert.isLength(results.errors, 1);
187
+
188
+ _testUtils.errorAssertUtil.assertError(results.errors[0], 'FAILED_TO_IMPORT', {
189
+ file: 'Bad.store.ts'
190
+ });
191
+
192
+ case 7:
178
193
  case "end":
179
194
  return _context5.stop();
180
195
  }
@@ -182,38 +197,34 @@ var KeepingDataStoresInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
182
197
  }, _callee5, this);
183
198
  }));
184
199
 
185
- function syncStores() {
186
- return _syncStores.apply(this, arguments);
200
+ function badFileReturnsError() {
201
+ return _badFileReturnsError.apply(this, arguments);
187
202
  }
188
203
 
189
- return syncStores;
204
+ return badFileReturnsError;
190
205
  }()
191
206
  }, {
192
- key: "badFileReturnsError",
207
+ key: "generatesValidTypeFile",
193
208
  value: function () {
194
- var _badFileReturnsError = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
209
+ var _generatesValidTypeFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
195
210
  var results;
196
211
  return _regenerator["default"].wrap(function _callee6$(_context6) {
197
212
  while (1) {
198
213
  switch (_context6.prev = _context6.next) {
199
214
  case 0:
200
- _spruceSkillUtils.diskUtil.writeFile(this.badStoreDest, 'throw new Error("Cheese!")');
201
-
202
- _context6.next = 3;
203
- return this.syncStores();
215
+ _context6.next = 2;
216
+ return this.Action('store', 'create').execute({
217
+ nameReadable: 'Bid',
218
+ nameReadablePlural: 'Bids',
219
+ namePascal: 'Bid'
220
+ });
204
221
 
205
- case 3:
222
+ case 2:
206
223
  results = _context6.sent;
224
+ _context6.next = 5;
225
+ return this.validateFiles(results);
207
226
 
208
- _test.assert.isArray(results.errors);
209
-
210
- _test.assert.isLength(results.errors, 1);
211
-
212
- _testUtils.errorAssertUtil.assertError(results.errors[0], 'FAILED_TO_IMPORT', {
213
- file: 'Bad.store.ts'
214
- });
215
-
216
- case 7:
227
+ case 5:
217
228
  case "end":
218
229
  return _context6.stop();
219
230
  }
@@ -221,54 +232,132 @@ var KeepingDataStoresInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
221
232
  }, _callee6, this);
222
233
  }));
223
234
 
224
- function badFileReturnsError() {
225
- return _badFileReturnsError.apply(this, arguments);
235
+ function generatesValidTypeFile() {
236
+ return _generatesValidTypeFile.apply(this, arguments);
226
237
  }
227
238
 
228
- return badFileReturnsError;
239
+ return generatesValidTypeFile;
229
240
  }()
230
241
  }, {
231
- key: "generatesValidTypeFile",
242
+ key: "fileIsValidAfterSync",
232
243
  value: function () {
233
- var _generatesValidTypeFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
234
- var results, typesFile;
244
+ var _fileIsValidAfterSync = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
245
+ var results;
235
246
  return _regenerator["default"].wrap(function _callee7$(_context7) {
236
247
  while (1) {
237
248
  switch (_context7.prev = _context7.next) {
238
249
  case 0:
239
250
  _context7.next = 2;
251
+ return this.syncStores();
252
+
253
+ case 2:
254
+ results = _context7.sent;
255
+ _context7.next = 5;
256
+ return this.validateFiles(results);
257
+
258
+ case 5:
259
+ case "end":
260
+ return _context7.stop();
261
+ }
262
+ }
263
+ }, _callee7, this);
264
+ }));
265
+
266
+ function fileIsValidAfterSync() {
267
+ return _fileIsValidAfterSync.apply(this, arguments);
268
+ }
269
+
270
+ return fileIsValidAfterSync;
271
+ }()
272
+ }, {
273
+ key: "canAddSecondStore",
274
+ value: function () {
275
+ var _canAddSecondStore = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
276
+ var results;
277
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
278
+ while (1) {
279
+ switch (_context8.prev = _context8.next) {
280
+ case 0:
281
+ _context8.next = 2;
240
282
  return this.Action('store', 'create').execute({
241
- nameReadable: 'Bid',
242
- nameReadablePlural: 'Bids',
243
- namePascal: 'Bid'
283
+ nameReadable: 'Person',
284
+ nameReadablePlural: 'People',
285
+ namePascal: 'Person'
244
286
  });
245
287
 
246
288
  case 2:
247
- _context7.next = 4;
248
- return this.syncStores();
289
+ results = _context8.sent;
290
+ _context8.next = 5;
291
+ return this.validateFiles(results);
249
292
 
250
- case 4:
251
- results = _context7.sent;
293
+ case 5:
294
+ case "end":
295
+ return _context8.stop();
296
+ }
297
+ }
298
+ }, _callee8, this);
299
+ }));
300
+
301
+ function canAddSecondStore() {
302
+ return _canAddSecondStore.apply(this, arguments);
303
+ }
304
+
305
+ return canAddSecondStore;
306
+ }()
307
+ }, {
308
+ key: "validateFiles",
309
+ value: function () {
310
+ var _validateFiles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(results) {
311
+ var typesFile, mapFile;
312
+ return _regenerator["default"].wrap(function _callee9$(_context9) {
313
+ while (1) {
314
+ switch (_context9.prev = _context9.next) {
315
+ case 0:
252
316
  typesFile = _test2["default"].assertFileByNameInGeneratedFiles('stores.types.ts', results.files);
253
- _context7.next = 8;
254
- return this.Service('typeChecker').check(typesFile);
317
+ mapFile = _test2["default"].assertFileByNameInGeneratedFiles('stores.ts', results.files);
318
+ _context9.next = 4;
319
+ return Promise.all([this.Service('typeChecker').check(typesFile), this.Service('typeChecker').check(mapFile)]);
255
320
 
256
- case 8:
321
+ case 4:
257
322
  case "end":
258
- return _context7.stop();
323
+ return _context9.stop();
259
324
  }
260
325
  }
261
- }, _callee7, this);
326
+ }, _callee9, this);
262
327
  }));
263
328
 
264
- function generatesValidTypeFile() {
265
- return _generatesValidTypeFile.apply(this, arguments);
329
+ function validateFiles(_x) {
330
+ return _validateFiles.apply(this, arguments);
266
331
  }
267
332
 
268
- return generatesValidTypeFile;
333
+ return validateFiles;
334
+ }()
335
+ }, {
336
+ key: "syncStores",
337
+ value: function () {
338
+ var _syncStores = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
339
+ return _regenerator["default"].wrap(function _callee10$(_context10) {
340
+ while (1) {
341
+ switch (_context10.prev = _context10.next) {
342
+ case 0:
343
+ return _context10.abrupt("return", this.Action('store', 'sync').execute({}));
344
+
345
+ case 1:
346
+ case "end":
347
+ return _context10.stop();
348
+ }
349
+ }
350
+ }, _callee10, this);
351
+ }));
352
+
353
+ function syncStores() {
354
+ return _syncStores.apply(this, arguments);
355
+ }
356
+
357
+ return syncStores;
269
358
  }()
270
359
  }]);
271
360
  return KeepingDataStoresInSyncTest;
272
- }(_AbstractSkillTest2["default"]), (0, _defineProperty2["default"])(_class2, "skillCacheKey", 'stores'), (0, _defineProperty2["default"])(_class2, "badStoreDest", void 0), _temp), ((0, _applyDecoratedDescriptor2["default"])(_class, "hasSyncAction", [_dec], Object.getOwnPropertyDescriptor(_class, "hasSyncAction"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "syncsNothingToStart", [_dec2], Object.getOwnPropertyDescriptor(_class, "syncsNothingToStart"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "badFileReturnsError", [_dec3], Object.getOwnPropertyDescriptor(_class, "badFileReturnsError"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "generatesValidTypeFile", [_dec4], Object.getOwnPropertyDescriptor(_class, "generatesValidTypeFile"), _class)), _class));
361
+ }(_AbstractSkillTest2["default"]), (0, _defineProperty2["default"])(_class2, "skillCacheKey", 'stores'), (0, _defineProperty2["default"])(_class2, "badStoreDest", void 0), _temp), ((0, _applyDecoratedDescriptor2["default"])(_class, "hasSyncAction", [_dec], Object.getOwnPropertyDescriptor(_class, "hasSyncAction"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "syncsNothingToStart", [_dec2], Object.getOwnPropertyDescriptor(_class, "syncsNothingToStart"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "badFileReturnsError", [_dec3], Object.getOwnPropertyDescriptor(_class, "badFileReturnsError"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "generatesValidTypeFile", [_dec4], Object.getOwnPropertyDescriptor(_class, "generatesValidTypeFile"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "fileIsValidAfterSync", [_dec5], Object.getOwnPropertyDescriptor(_class, "fileIsValidAfterSync"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "canAddSecondStore", [_dec6], Object.getOwnPropertyDescriptor(_class, "canAddSecondStore"), _class)), _class));
273
362
  exports["default"] = KeepingDataStoresInSyncTest;
274
363
  //# sourceMappingURL=KeepingDataStoresInSync.test.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/__tests__/behavioral/stores/KeepingDataStoresInSync.test.ts"],"names":["KeepingDataStoresInSyncTest","badStoreDest","resolvePath","diskUtil","deleteFile","assert","isFunction","Action","execute","syncStores","results","isLength","files","writeFile","isArray","errors","errorAssertUtil","assertError","file","nameReadable","nameReadablePlural","namePascal","typesFile","testUtil","assertFileByNameInGeneratedFiles","Service","check","AbstractSkillTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAC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AAgBD,OAAO,CAACK,MAAxB,EAAgC,CAAhC;;AAEAC,2CAAgBC,WAAhB,CAA4BP,OAAO,CAACK,MAAR,CAAe,CAAf,CAA5B,EAA+C,kBAA/C,EAAmE;AAClEG,kBAAAA,IAAI,EAAE;AAD4D,iBAAnE;;AARD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;kHAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEO,KAAKX,MAAL,CAAY,OAAZ,EAAqB,QAArB,EAA+BC,OAA/B,CAAuC;AAC5CW,kBAAAA,YAAY,EAAE,KAD8B;AAE5CC,kBAAAA,kBAAkB,EAAE,MAFwB;AAG5CC,kBAAAA,UAAU,EAAE;AAHgC,iBAAvC,CAFP;;AAAA;AAAA;AAAA,uBAQuB,KAAKZ,UAAL,EARvB;;AAAA;AAQOC,gBAAAA,OARP;AAUOY,gBAAAA,SAVP,GAUmBC,kBAASC,gCAAT,CACjB,iBADiB,EAEjBd,OAAO,CAACE,KAFS,CAVnB;AAAA;AAAA,uBAeO,KAAKa,OAAL,CAAa,aAAb,EAA4BC,KAA5B,CAAkCJ,SAAlC,CAfP;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EA1CwDK,8B,8DACvB,Q","sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport { errorAssertUtil } from '@sprucelabs/test-utils'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class KeepingDataStoresInSyncTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'stores'\n\tprotected static badStoreDest: string\n\tprotected static async beforeAll() {\n\t\tawait super.beforeAll()\n\t\tthis.badStoreDest = this.resolvePath('src/stores/Bad.store.ts')\n\t}\n\n\tprotected static async beforeEach() {\n\t\tawait super.beforeEach()\n\t\tdiskUtil.deleteFile(this.badStoreDest)\n\t}\n\n\t@test()\n\tprotected static async hasSyncAction() {\n\t\tassert.isFunction(this.Action('store', 'sync').execute)\n\t}\n\n\t@test()\n\tprotected static async syncsNothingToStart() {\n\t\tconst results = await this.syncStores()\n\n\t\tassert.isLength(results.files, 0)\n\t}\n\n\tprivate static async syncStores() {\n\t\treturn this.Action('store', 'sync').execute({})\n\t}\n\n\t@test()\n\tprotected static async badFileReturnsError() {\n\t\tdiskUtil.writeFile(this.badStoreDest, 'throw new Error(\"Cheese!\")')\n\n\t\tconst results = await this.syncStores()\n\t\tassert.isArray(results.errors)\n\t\tassert.isLength(results.errors, 1)\n\n\t\terrorAssertUtil.assertError(results.errors[0], 'FAILED_TO_IMPORT', {\n\t\t\tfile: 'Bad.store.ts',\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async generatesValidTypeFile() {\n\t\tawait this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tconst results = await this.syncStores()\n\n\t\tconst typesFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'stores.types.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait this.Service('typeChecker').check(typesFile)\n\t}\n}\n"],"file":"KeepingDataStoresInSync.test.js"}
1
+ {"version":3,"sources":["../../../../src/__tests__/behavioral/stores/KeepingDataStoresInSync.test.ts"],"names":["KeepingDataStoresInSyncTest","badStoreDest","resolvePath","diskUtil","deleteFile","assert","isFunction","Action","execute","syncStores","results","isLength","files","writeFile","isArray","errors","errorAssertUtil","assertError","file","nameReadable","nameReadablePlural","namePascal","validateFiles","typesFile","testUtil","assertFileByNameInGeneratedFiles","mapFile","Promise","all","Service","check","AbstractSkillTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;IAEqBA,2B,WAanB,iB,UAKA,iB,UAOA,iB,UAaA,iB,UAWA,iB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O,CAACC,GAAR,CAAY,CACjB,KAAKC,OAAL,CAAa,aAAb,EAA4BC,KAA5B,CAAkCP,SAAlC,CADiB,EAEjB,KAAKM,OAAL,CAAa,aAAb,EAA4BC,KAA5B,CAAkCJ,OAAlC,CAFiB,CAAZ,CAXP;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;sGAiBA;AAAA;AAAA;AAAA;AAAA;AAAA,mDACQ,KAAKnB,MAAL,CAAY,OAAZ,EAAqB,MAArB,EAA6BC,OAA7B,CAAqC,EAArC,CADR;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EApFwDuB,8B,8DACvB,Q","sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport { errorAssertUtil } from '@sprucelabs/test-utils'\nimport { FeatureActionResponse } from '../../../features/features.types'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class KeepingDataStoresInSyncTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'stores'\n\tprotected static badStoreDest: string\n\tprotected static async beforeAll() {\n\t\tawait super.beforeAll()\n\t\tthis.badStoreDest = this.resolvePath('src/stores/Bad.store.ts')\n\t}\n\n\tprotected static async beforeEach() {\n\t\tawait super.beforeEach()\n\t\tdiskUtil.deleteFile(this.badStoreDest)\n\t}\n\n\t@test()\n\tprotected static async hasSyncAction() {\n\t\tassert.isFunction(this.Action('store', 'sync').execute)\n\t}\n\n\t@test()\n\tprotected static async syncsNothingToStart() {\n\t\tconst results = await this.syncStores()\n\n\t\tassert.isLength(results.files, 0)\n\t}\n\n\t@test()\n\tprotected static async badFileReturnsError() {\n\t\tdiskUtil.writeFile(this.badStoreDest, 'throw new Error(\"Cheese!\")')\n\n\t\tconst results = await this.syncStores()\n\t\tassert.isArray(results.errors)\n\t\tassert.isLength(results.errors, 1)\n\n\t\terrorAssertUtil.assertError(results.errors[0], 'FAILED_TO_IMPORT', {\n\t\t\tfile: 'Bad.store.ts',\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async generatesValidTypeFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tawait this.validateFiles(results)\n\t}\n\n\t@test()\n\tprotected static async fileIsValidAfterSync() {\n\t\tconst results = await this.syncStores()\n\n\t\tawait this.validateFiles(results)\n\t}\n\n\t@test()\n\tprotected static async canAddSecondStore() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Person',\n\t\t\tnameReadablePlural: 'People',\n\t\t\tnamePascal: 'Person',\n\t\t})\n\n\t\tawait this.validateFiles(results)\n\t}\n\n\tprivate static async validateFiles(results: FeatureActionResponse) {\n\t\tconst typesFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'stores.types.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst mapFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'stores.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait Promise.all([\n\t\t\tthis.Service('typeChecker').check(typesFile),\n\t\t\tthis.Service('typeChecker').check(mapFile),\n\t\t])\n\t}\n\n\tprivate static async syncStores() {\n\t\treturn this.Action('store', 'sync').execute({})\n\t}\n}\n"],"file":"KeepingDataStoresInSync.test.js"}
@@ -25,6 +25,8 @@ var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/
25
25
 
26
26
  var _test = require("@sprucelabs/test");
27
27
 
28
+ var _LintService = _interopRequireDefault(require("../../../services/LintService"));
29
+
28
30
  var _AbstractTestTest2 = _interopRequireDefault(require("../../../tests/AbstractTestTest"));
29
31
 
30
32
  var _test2 = _interopRequireDefault(require("../../../tests/utilities/test.utility"));
@@ -119,40 +121,42 @@ var CreatingBehavioralTestsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
119
121
  while (1) {
120
122
  switch (_context3.prev = _context3.next) {
121
123
  case 0:
122
- _context3.next = 2;
124
+ _LintService["default"].enableLinting();
125
+
126
+ _context3.next = 3;
123
127
  return this.installTests();
124
128
 
125
- case 2:
129
+ case 3:
126
130
  promise = this.Action('test', 'create').execute({
127
131
  type: 'behavioral',
128
132
  nameReadable: 'Can book appointment',
129
133
  nameCamel: 'canBookAppointment',
130
134
  namePascal: 'CanBookAppointment'
131
135
  });
132
- _context3.next = 5;
136
+ _context3.next = 6;
133
137
  return this.waitForInput();
134
138
 
135
- case 5:
139
+ case 6:
136
140
  this.selectOptionBasedOnLabel(testName);
137
- _context3.next = 8;
141
+ _context3.next = 9;
138
142
  return promise;
139
143
 
140
- case 8:
144
+ case 9:
141
145
  response = _context3.sent;
142
146
  match = _test2["default"].assertFileByNameInGeneratedFiles('CanBookAppointment.test.ts', response.files);
143
147
 
144
148
  _test.assert.doesInclude(match, 'behavioral');
145
149
 
146
- _context3.next = 13;
150
+ _context3.next = 14;
147
151
  return this.Service('build').build();
148
152
 
149
- case 13:
150
- _context3.next = 15;
153
+ case 14:
154
+ _context3.next = 16;
151
155
  return _test.assert.doesThrowAsync(function () {
152
156
  return _this.Service('command').execute('yarn test');
153
157
  }, /false[\s\S]*?does not equal[\s\S]*?true/gi);
154
158
 
155
- case 15:
159
+ case 16:
156
160
  case "end":
157
161
  return _context3.stop();
158
162
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/__tests__/behavioral/tests/CreatingATest.test.ts"],"names":["CreatingBehavioralTestsTest","assert","isFunction","Action","execute","installTests","testFeature","getFeatureInstaller","getFeature","buildParentClassCandidates","candidates","doesInclude","label","name","testName","promise","type","nameReadable","nameCamel","namePascal","waitForInput","selectOptionBasedOnLabel","response","match","testUtil","assertFileByNameInGeneratedFiles","files","Service","build","doesThrowAsync","AbstractTestTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;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AA,QArBP;AAuBOC,gBAAAA,KAvBP,GAuBeC,kBAASC,gCAAT,CACb,4BADa,EAEbH,QAAQ,CAACI,KAFI,CAvBf;;AA4BCzB,6BAAOU,WAAP,CAAmBY,KAAnB,EAA0B,YAA1B;;AA5BD;AAAA,uBA8BO,KAAKI,OAAL,CAAa,OAAb,EAAsBC,KAAtB,EA9BP;;AAAA;AAAA;AAAA,uBAgCO3B,aAAO4B,cAAP,CACL;AAAA,yBAAM,KAAI,CAACF,OAAL,CAAa,SAAb,EAAwBvB,OAAxB,CAAgC,WAAhC,CAAN;AAAA,iBADK,EAEL,2CAFK,CAhCP;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EAnBwD0B,6B","sourcesContent":["import { test, assert } from '@sprucelabs/test'\nimport AbstractTestTest from '../../../tests/AbstractTestTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class CreatingBehavioralTestsTest extends AbstractTestTest {\n\t@test()\n\tprotected static async hasCreateAction() {\n\t\tassert.isFunction(this.Action('test', 'create').execute)\n\t}\n\n\t@test()\n\tprotected static async requiresInstallIfSkilLNotInstalled() {\n\t\tawait this.installTests('testsInNodeModule')\n\n\t\tconst testFeature = this.getFeatureInstaller().getFeature('test')\n\t\tconst candidates = await testFeature.buildParentClassCandidates()\n\n\t\tassert.doesInclude(candidates, {\n\t\t\tlabel: 'AbstractSpruceFixtureTest (requires install)',\n\t\t\tname: 'AbstractSpruceFixtureTest',\n\t\t})\n\t}\n\n\t@test(\n\t\t'can create behavioral test with AbstractSpruceFixtureTest',\n\t\t'AbstractSpruceFixtureTest'\n\t)\n\t@test(\n\t\t'can create behavioral test with AbstractSpruceFixtureTest',\n\t\t'AbstractStoreTest (requires install)'\n\t)\n\tprotected static async canCreateBehavioralTest(testName: string) {\n\t\tawait this.installTests()\n\t\tconst promise = this.Action('test', 'create').execute({\n\t\t\ttype: 'behavioral',\n\t\t\tnameReadable: 'Can book appointment',\n\t\t\tnameCamel: 'canBookAppointment',\n\t\t\tnamePascal: 'CanBookAppointment',\n\t\t})\n\n\t\tawait this.waitForInput()\n\n\t\tthis.selectOptionBasedOnLabel(testName)\n\n\t\tconst response = await promise\n\n\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'CanBookAppointment.test.ts',\n\t\t\tresponse.files\n\t\t)\n\n\t\tassert.doesInclude(match, 'behavioral')\n\n\t\tawait this.Service('build').build()\n\n\t\tawait assert.doesThrowAsync(\n\t\t\t() => this.Service('command').execute('yarn test'),\n\t\t\t/false.*?does not equal.*?true/gis\n\t\t)\n\t}\n}\n"],"file":"CreatingATest.test.js"}
1
+ {"version":3,"sources":["../../../../src/__tests__/behavioral/tests/CreatingATest.test.ts"],"names":["CreatingBehavioralTestsTest","assert","isFunction","Action","execute","installTests","testFeature","getFeatureInstaller","getFeature","buildParentClassCandidates","candidates","doesInclude","label","name","testName","LintService","enableLinting","promise","type","nameReadable","nameCamel","namePascal","waitForInput","selectOptionBasedOnLabel","response","match","testUtil","assertFileByNameInGeneratedFiles","files","Service","build","doesThrowAsync","AbstractTestTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,2B,WACnB,iB,UAKA,iB,UAaA,gBACA,2DADA,EAEA,2BAFA,C,UAIA,gBACA,2DADA,EAEA,sCAFA,C;;;;;;;;;;;;;2GAtBD;AAAA;AAAA;AAAA;AAAA;AAECC,6BAAOC,UAAP,CAAkB,KAAKC,MAAL,CAAY,MAAZ,EAAoB,QAApB,EAA8BC,OAAhD;;AAFD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;8HAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEO,KAAKC,YAAL,CAAkB,mBAAlB,CAFP;;AAAA;AAIOC,gBAAAA,WAJP,GAIqB,KAAKC,mBAAL,GAA2BC,UAA3B,CAAsC,MAAtC,CAJrB;AAAA;AAAA,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ourcesContent":["import { test, assert } from '@sprucelabs/test'\nimport LintService from '../../../services/LintService'\nimport AbstractTestTest from '../../../tests/AbstractTestTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class CreatingBehavioralTestsTest extends AbstractTestTest {\n\t@test()\n\tprotected static async hasCreateAction() {\n\t\tassert.isFunction(this.Action('test', 'create').execute)\n\t}\n\n\t@test()\n\tprotected static async requiresInstallIfSkilLNotInstalled() {\n\t\tawait this.installTests('testsInNodeModule')\n\n\t\tconst testFeature = this.getFeatureInstaller().getFeature('test')\n\t\tconst candidates = await testFeature.buildParentClassCandidates()\n\n\t\tassert.doesInclude(candidates, {\n\t\t\tlabel: 'AbstractSpruceFixtureTest (requires install)',\n\t\t\tname: 'AbstractSpruceFixtureTest',\n\t\t})\n\t}\n\n\t@test(\n\t\t'can create behavioral test with AbstractSpruceFixtureTest',\n\t\t'AbstractSpruceFixtureTest'\n\t)\n\t@test(\n\t\t'can create behavioral test with AbstractSpruceFixtureTest',\n\t\t'AbstractStoreTest (requires install)'\n\t)\n\tprotected static async canCreateBehavioralTest(testName: string) {\n\t\tLintService.enableLinting()\n\t\tawait this.installTests()\n\t\tconst promise = this.Action('test', 'create').execute({\n\t\t\ttype: 'behavioral',\n\t\t\tnameReadable: 'Can book appointment',\n\t\t\tnameCamel: 'canBookAppointment',\n\t\t\tnamePascal: 'CanBookAppointment',\n\t\t})\n\n\t\tawait this.waitForInput()\n\n\t\tthis.selectOptionBasedOnLabel(testName)\n\n\t\tconst response = await promise\n\n\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'CanBookAppointment.test.ts',\n\t\t\tresponse.files\n\t\t)\n\n\t\tassert.doesInclude(match, 'behavioral')\n\n\t\tawait this.Service('build').build()\n\n\t\tawait assert.doesThrowAsync(\n\t\t\t() => this.Service('command').execute('yarn test'),\n\t\t\t/false.*?does not equal.*?true/gis\n\t\t)\n\t}\n}\n"],"file":"CreatingATest.test.js"}
@@ -1,6 +1,7 @@
1
1
  import AbstractSkillTest from '../../../tests/AbstractSkillTest';
2
2
  export default class TestingViewControllersTest extends AbstractSkillTest {
3
3
  protected static skillCacheKey: string;
4
+ protected static beforeEach(): Promise<void>;
4
5
  protected static showsNotInstalled(): Promise<void>;
5
6
  protected static canSelectAbstractTest(): Promise<void>;
6
7
  protected static testsRun(): Promise<void>;
@@ -15,6 +15,8 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
15
15
 
16
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
17
 
18
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
19
+
18
20
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
21
 
20
22
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
@@ -29,6 +31,8 @@ var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
29
31
 
30
32
  var _test = require("@sprucelabs/test");
31
33
 
34
+ var _LintService = _interopRequireDefault(require("../../../services/LintService"));
35
+
32
36
  var _AbstractSkillTest2 = _interopRequireDefault(require("../../../tests/AbstractSkillTest"));
33
37
 
34
38
  var _test2 = _interopRequireDefault(require("../../../tests/utilities/test.utility"));
@@ -50,31 +54,59 @@ var TestingViewControllersTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.te
50
54
  }
51
55
 
52
56
  (0, _createClass2["default"])(TestingViewControllersTest, null, [{
57
+ key: "beforeEach",
58
+ value: function () {
59
+ var _beforeEach = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
60
+ return _regenerator["default"].wrap(function _callee$(_context) {
61
+ while (1) {
62
+ switch (_context.prev = _context.next) {
63
+ case 0:
64
+ _context.next = 2;
65
+ return (0, _get2["default"])((0, _getPrototypeOf2["default"])(TestingViewControllersTest), "beforeEach", this).call(this);
66
+
67
+ case 2:
68
+ _LintService["default"].enableLinting();
69
+
70
+ case 3:
71
+ case "end":
72
+ return _context.stop();
73
+ }
74
+ }
75
+ }, _callee, this);
76
+ }));
77
+
78
+ function beforeEach() {
79
+ return _beforeEach.apply(this, arguments);
80
+ }
81
+
82
+ return beforeEach;
83
+ }()
84
+ }, {
53
85
  key: "showsNotInstalled",
54
86
  value: function () {
55
- var _showsNotInstalled = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
87
+ var _showsNotInstalled = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
56
88
  var viewFeature, last;
57
- return _regenerator["default"].wrap(function _callee2$(_context2) {
89
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
58
90
  while (1) {
59
- switch (_context2.prev = _context2.next) {
91
+ switch (_context3.prev = _context3.next) {
60
92
  case 0:
61
93
  viewFeature = this.cli.getFeature('view');
62
- viewFeature.isInstalled = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
63
- return _regenerator["default"].wrap(function _callee$(_context) {
94
+ viewFeature.isInstalled = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
95
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
64
96
  while (1) {
65
- switch (_context.prev = _context.next) {
97
+ switch (_context2.prev = _context2.next) {
66
98
  case 0:
67
- return _context.abrupt("return", false);
99
+ return _context2.abrupt("return", false);
68
100
 
69
101
  case 1:
70
102
  case "end":
71
- return _context.stop();
103
+ return _context2.stop();
72
104
  }
73
105
  }
74
- }, _callee);
106
+ }, _callee2);
75
107
  }));
76
108
  void this.executeCreate();
77
- _context2.next = 5;
109
+ _context3.next = 5;
78
110
  return this.waitForInput();
79
111
 
80
112
  case 5:
@@ -88,10 +120,10 @@ var TestingViewControllersTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.te
88
120
 
89
121
  case 8:
90
122
  case "end":
91
- return _context2.stop();
123
+ return _context3.stop();
92
124
  }
93
125
  }
94
- }, _callee2, this);
126
+ }, _callee3, this);
95
127
  }));
96
128
 
97
129
  function showsNotInstalled() {
@@ -103,14 +135,14 @@ var TestingViewControllersTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.te
103
135
  }, {
104
136
  key: "canSelectAbstractTest",
105
137
  value: function () {
106
- var _canSelectAbstractTest = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
138
+ var _canSelectAbstractTest = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
107
139
  var last;
108
- return _regenerator["default"].wrap(function _callee3$(_context3) {
140
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
109
141
  while (1) {
110
- switch (_context3.prev = _context3.next) {
142
+ switch (_context4.prev = _context4.next) {
111
143
  case 0:
112
144
  void this.executeCreate();
113
- _context3.next = 3;
145
+ _context4.next = 3;
114
146
  return this.waitForInput();
115
147
 
116
148
  case 3:
@@ -124,10 +156,10 @@ var TestingViewControllersTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.te
124
156
 
125
157
  case 6:
126
158
  case "end":
127
- return _context3.stop();
159
+ return _context4.stop();
128
160
  }
129
161
  }
130
- }, _callee3, this);
162
+ }, _callee4, this);
131
163
  }));
132
164
 
133
165
  function canSelectAbstractTest() {
@@ -139,25 +171,25 @@ var TestingViewControllersTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.te
139
171
  }, {
140
172
  key: "testsRun",
141
173
  value: function () {
142
- var _testsRun = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
174
+ var _testsRun = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
143
175
  var _testResults$meta;
144
176
 
145
177
  var promise, results, match, contents, testResults;
146
- return _regenerator["default"].wrap(function _callee4$(_context4) {
178
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
147
179
  while (1) {
148
- switch (_context4.prev = _context4.next) {
180
+ switch (_context5.prev = _context5.next) {
149
181
  case 0:
150
182
  promise = this.executeCreate();
151
- _context4.next = 3;
183
+ _context5.next = 3;
152
184
  return this.waitForInput();
153
185
 
154
186
  case 3:
155
187
  this.selectOptionBasedOnLabel('AbstractViewControllerTest');
156
- _context4.next = 6;
188
+ _context5.next = 6;
157
189
  return promise;
158
190
 
159
191
  case 6:
160
- results = _context4.sent;
192
+ results = _context5.sent;
161
193
 
162
194
  _test.assert.isFalsy(results.errors);
163
195
 
@@ -168,17 +200,17 @@ var TestingViewControllersTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.te
168
200
 
169
201
  _test.assert.doesInclude(contents, "import { AbstractViewControllerTest } from '@sprucelabs/spruce-view-plugin'");
170
202
 
171
- _context4.next = 14;
203
+ _context5.next = 14;
172
204
  return this.Service('build').build();
173
205
 
174
206
  case 14:
175
- _context4.next = 16;
207
+ _context5.next = 16;
176
208
  return this.Action('test', 'test').execute({
177
209
  shouldReportWhileRunning: false
178
210
  });
179
211
 
180
212
  case 16:
181
- testResults = _context4.sent;
213
+ testResults = _context5.sent;
182
214
 
183
215
  _test.assert.isArray(testResults.errors);
184
216
 
@@ -191,10 +223,10 @@ var TestingViewControllersTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.te
191
223
 
192
224
  case 20:
193
225
  case "end":
194
- return _context4.stop();
226
+ return _context5.stop();
195
227
  }
196
228
  }
197
- }, _callee4, this);
229
+ }, _callee5, this);
198
230
  }));
199
231
 
200
232
  function testsRun() {
@@ -206,12 +238,12 @@ var TestingViewControllersTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.te
206
238
  }, {
207
239
  key: "executeCreate",
208
240
  value: function () {
209
- var _executeCreate = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
210
- return _regenerator["default"].wrap(function _callee5$(_context5) {
241
+ var _executeCreate = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
242
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
211
243
  while (1) {
212
- switch (_context5.prev = _context5.next) {
244
+ switch (_context6.prev = _context6.next) {
213
245
  case 0:
214
- return _context5.abrupt("return", this.Action('test', 'create').execute({
246
+ return _context6.abrupt("return", this.Action('test', 'create').execute({
215
247
  type: 'behavioral',
216
248
  nameReadable: 'Rendering root view controller',
217
249
  nameCamel: 'renderingRootViewController',
@@ -220,10 +252,10 @@ var TestingViewControllersTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.te
220
252
 
221
253
  case 1:
222
254
  case "end":
223
- return _context5.stop();
255
+ return _context6.stop();
224
256
  }
225
257
  }
226
- }, _callee5, this);
258
+ }, _callee6, this);
227
259
  }));
228
260
 
229
261
  function executeCreate() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/__tests__/behavioral/views/TestingViewControllers.test.ts"],"names":["TestingViewControllersTest","viewFeature","cli","getFeature","isInstalled","executeCreate","waitForInput","last","ui","getLastInvocation","assert","doesInclude","options","choices","label","reset","promise","selectOptionBasedOnLabel","results","isFalsy","errors","match","testUtil","assertFileByNameInGeneratedFiles","files","contents","diskUtil","readFile","Service","build","Action","execute","shouldReportWhileRunning","testResults","isArray","isLength","meta","testFiles","path","status","type","nameReadable","nameCamel","namePascal","AbstractSkillTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,0B,WAGnB,iB,UAiBA,iB,UAcA,iB;;;;;;;;;;;;;6GA/BD;AAAA;AAAA;AAAA;AAAA;AAAA;AAEOC,gBAAAA,WAFP,GAEqB,KAAKC,GAAL,CAASC,UAAT,CAAoB,MAApB,CAFrB;AAGCF,gBAAAA,WAAW,CAACG,WAAZ,8FAA0B;AAAA;AAAA;AAAA;AAAA;AAAA,2DAAY,KAAZ;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA1B;AAEA,qBAAK,KAAKC,aAAL,EAAL;AALD;AA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EAEC,6EAFD;;AAtBD;AAAA,uBA2BO,KAAKG,OAAL,CAAa,OAAb,EAAsBC,KAAtB,EA3BP;;AAAA;AAAA;AAAA,uBA6B2B,KAAKC,MAAL,CAAY,MAAZ,EAAoB,MAApB,EAA4BC,OAA5B,CAAoC;AAC7DC,kBAAAA,wBAAwB,EAAE;AADmC,iBAApC,CA7B3B;;AAAA;AA6BOC,gBAAAA,WA7BP;;AAiCCvB,6BAAOwB,OAAP,CAAeD,WAAW,CAACb,MAA3B;;AACAV,6BAAOyB,QAAP,CAAgBF,WAAW,CAACb,MAA5B,EAAoC,CAApC;;AAEAV,6BAAOC,WAAP,sBAAmBsB,WAAW,CAACG,IAA/B,sDAAmB,kBAAkBH,WAAlB,CAA8BI,SAAjD,EAA4D;AAC3DC,kBAAAA,IAAI,EAAE,gDADqD;AAE3DC,kBAAAA,MAAM,EAAE;AAFmD,iBAA5D;;AApCD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;yGA0CA;AAAA;AAAA;AAAA;AAAA;AAAA,kDACQ,KAAKT,MAAL,CAAY,MAAZ,EAAoB,QAApB,EAA8BC,OAA9B,CAAsC;AAC5CS,kBAAAA,IAAI,EAAE,YADsC;AAE5CC,kBAAAA,YAAY,EAAE,gCAF8B;AAG5CC,kBAAAA,SAAS,EAAE,6BAHiC;AAI5CC,kBAAAA,UAAU,EAAE;AAJgC,iBAAtC,CADR;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EA5EuDC,8B,8DACtB,gB","sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class TestingViewControllersTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'viewsWithTests'\n\n\t@test()\n\tprotected static async showsNotInstalled() {\n\t\tconst viewFeature = this.cli.getFeature('view')\n\t\tviewFeature.isInstalled = async () => false\n\n\t\tvoid this.executeCreate()\n\n\t\tawait this.waitForInput()\n\n\t\tconst last = this.ui.getLastInvocation()\n\t\tassert.doesInclude(last.options.options.choices, {\n\t\t\tlabel: 'AbstractViewControllerTest (requires install)',\n\t\t})\n\n\t\tthis.ui.reset()\n\t}\n\n\t@test()\n\tprotected static async canSelectAbstractTest() {\n\t\tvoid this.executeCreate()\n\n\t\tawait this.waitForInput()\n\n\t\tconst last = this.ui.getLastInvocation()\n\t\tassert.doesInclude(last.options.options.choices, {\n\t\t\tlabel: 'AbstractViewControllerTest',\n\t\t})\n\n\t\tthis.ui.reset()\n\t}\n\n\t@test()\n\tprotected static async testsRun() {\n\t\tconst promise = this.executeCreate()\n\n\t\tawait this.waitForInput()\n\n\t\tthis.selectOptionBasedOnLabel('AbstractViewControllerTest')\n\n\t\tconst results = await promise\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'RenderingRootViewController.test.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst contents = diskUtil.readFile(match)\n\t\tassert.doesInclude(\n\t\t\tcontents,\n\t\t\t'RenderingRootViewControllerTest extends AbstractViewControllerTest'\n\t\t)\n\t\tassert.doesInclude(\n\t\t\tcontents,\n\t\t\t\"import { AbstractViewControllerTest } from '@sprucelabs/spruce-view-plugin'\"\n\t\t)\n\n\t\tawait this.Service('build').build()\n\n\t\tconst testResults = await this.Action('test', 'test').execute({\n\t\t\tshouldReportWhileRunning: false,\n\t\t})\n\n\t\tassert.isArray(testResults.errors)\n\t\tassert.isLength(testResults.errors, 1)\n\n\t\tassert.doesInclude(testResults.meta?.testResults.testFiles, {\n\t\t\tpath: 'behavioral/RenderingRootViewController.test.ts',\n\t\t\tstatus: 'failed',\n\t\t})\n\t}\n\n\tprivate static async executeCreate() {\n\t\treturn this.Action('test', 'create').execute({\n\t\t\ttype: 'behavioral',\n\t\t\tnameReadable: 'Rendering root view controller',\n\t\t\tnameCamel: 'renderingRootViewController',\n\t\t\tnamePascal: 'RenderingRootViewController',\n\t\t})\n\t}\n}\n"],"file":"TestingViewControllers.test.js"}
1
+ {"version":3,"sources":["../../../../src/__tests__/behavioral/views/TestingViewControllers.test.ts"],"names":["TestingViewControllersTest","LintService","enableLinting","viewFeature","cli","getFeature","isInstalled","executeCreate","waitForInput","last","ui","getLastInvocation","assert","doesInclude","options","choices","label","reset","promise","selectOptionBasedOnLabel","results","isFalsy","errors","match","testUtil","assertFileByNameInGeneratedFiles","files","contents","diskUtil","readFile","Service","build","Action","execute","shouldReportWhileRunning","testResults","isArray","isLength","meta","testFiles","path","status","type","nameReadable","nameCamel","namePascal","AbstractSkillTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,0B,WAQnB,iB,UAiBA,iB,UAcA,iB;;;;;;;;;;;;;sGApCD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAECC,wCAAYC,aAAZ;;AAFD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;6GAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEOC,gBAAAA,WAFP,GAEqB,KAAKC,GAAL,CAASC,UAAT,CAAoB,MAApB,CAFrB;AAGCF,gBAAAA,WAAW,CAACG,WAAZ,8FAA0B;AAAA;AAAA;AAAA;AAAA;AAAA,4DAAY,KAAZ;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA1B;AAEA,qBAAK,KAAKC,aAAL,EAAL;AALD;AAAA,uBAOO,KAAKC,YAAL,EAPP;;AAAA;AASOC,gBAAAA,IATP,GASc,KAAKC,EAAL,CAAQC,iBAAR,EATd;;AAUCC,6BAAOC,WAAP,CAAmBJ,IAAI,CAACK,OAAL,CAAaA,OAAb,CAAqBC,OAAxC,EAAiD;AAChDC,kBAAAA,KAAK,EAAE;AADyC,iBAAjD;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7B3B;;AAAA;AA6BOC,gBAAAA,WA7BP;;AAiCCvB,6BAAOwB,OAAP,CAAeD,WAAW,CAACb,MAA3B;;AACAV,6BAAOyB,QAAP,CAAgBF,WAAW,CAACb,MAA5B,EAAoC,CAApC;;AAEAV,6BAAOC,WAAP,sBAAmBsB,WAAW,CAACG,IAA/B,sDAAmB,kBAAkBH,WAAlB,CAA8BI,SAAjD,EAA4D;AAC3DC,kBAAAA,IAAI,EAAE,gDADqD;AAE3DC,kBAAAA,MAAM,EAAE;AAFmD,iBAA5D;;AApCD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;yGA0CA;AAAA;AAAA;AAAA;AAAA;AAAA,kDACQ,KAAKT,MAAL,CAAY,MAAZ,EAAoB,QAApB,EAA8BC,OAA9B,CAAsC;AAC5CS,kBAAAA,IAAI,EAAE,YADsC;AAE5CC,kBAAAA,YAAY,EAAE,gCAF8B;AAG5CC,kBAAAA,SAAS,EAAE,6BAHiC;AAI5CC,kBAAAA,UAAU,EAAE;AAJgC,iBAAtC,CADR;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EAjFuDC,8B,8DACtB,gB","sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport LintService from '../../../services/LintService'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class TestingViewControllersTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'viewsWithTests'\n\n\tprotected static async beforeEach() {\n\t\tawait super.beforeEach()\n\t\tLintService.enableLinting()\n\t}\n\n\t@test()\n\tprotected static async showsNotInstalled() {\n\t\tconst viewFeature = this.cli.getFeature('view')\n\t\tviewFeature.isInstalled = async () => false\n\n\t\tvoid this.executeCreate()\n\n\t\tawait this.waitForInput()\n\n\t\tconst last = this.ui.getLastInvocation()\n\t\tassert.doesInclude(last.options.options.choices, {\n\t\t\tlabel: 'AbstractViewControllerTest (requires install)',\n\t\t})\n\n\t\tthis.ui.reset()\n\t}\n\n\t@test()\n\tprotected static async canSelectAbstractTest() {\n\t\tvoid this.executeCreate()\n\n\t\tawait this.waitForInput()\n\n\t\tconst last = this.ui.getLastInvocation()\n\t\tassert.doesInclude(last.options.options.choices, {\n\t\t\tlabel: 'AbstractViewControllerTest',\n\t\t})\n\n\t\tthis.ui.reset()\n\t}\n\n\t@test()\n\tprotected static async testsRun() {\n\t\tconst promise = this.executeCreate()\n\n\t\tawait this.waitForInput()\n\n\t\tthis.selectOptionBasedOnLabel('AbstractViewControllerTest')\n\n\t\tconst results = await promise\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'RenderingRootViewController.test.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst contents = diskUtil.readFile(match)\n\t\tassert.doesInclude(\n\t\t\tcontents,\n\t\t\t'RenderingRootViewControllerTest extends AbstractViewControllerTest'\n\t\t)\n\t\tassert.doesInclude(\n\t\t\tcontents,\n\t\t\t\"import { AbstractViewControllerTest } from '@sprucelabs/spruce-view-plugin'\"\n\t\t)\n\n\t\tawait this.Service('build').build()\n\n\t\tconst testResults = await this.Action('test', 'test').execute({\n\t\t\tshouldReportWhileRunning: false,\n\t\t})\n\n\t\tassert.isArray(testResults.errors)\n\t\tassert.isLength(testResults.errors, 1)\n\n\t\tassert.doesInclude(testResults.meta?.testResults.testFiles, {\n\t\t\tpath: 'behavioral/RenderingRootViewController.test.ts',\n\t\t\tstatus: 'failed',\n\t\t})\n\t}\n\n\tprivate static async executeCreate() {\n\t\treturn this.Action('test', 'create').execute({\n\t\t\ttype: 'behavioral',\n\t\t\tnameReadable: 'Rendering root view controller',\n\t\t\tnameCamel: 'renderingRootViewController',\n\t\t\tnamePascal: 'RenderingRootViewController',\n\t\t})\n\t}\n}\n"],"file":"TestingViewControllers.test.js"}