@sprucelabs/spruce-cli 14.30.9 → 14.30.13

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 (43) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/build/__tests__/behavioral/AddingADependency.test.js +2 -2
  3. package/build/__tests__/behavioral/AddingADependency.test.js.map +1 -1
  4. package/build/__tests__/behavioral/DeployingToSandbox.test.js +1 -1
  5. package/build/__tests__/behavioral/DeployingToSandbox.test.js.map +1 -1
  6. package/build/__tests__/behavioral/InstallingASkillAtAnOrg.test.js +2 -2
  7. package/build/__tests__/behavioral/InstallingASkillAtAnOrg.test.js.map +1 -1
  8. package/build/__tests__/behavioral/LoggingInAsASkill.test.js +3 -3
  9. package/build/__tests__/behavioral/LoggingInAsASkill.test.js.map +1 -1
  10. package/build/__tests__/behavioral/RegisteringEventsOnBoot.test.js +1 -1
  11. package/build/__tests__/behavioral/RegisteringEventsOnBoot.test.js.map +1 -1
  12. package/build/__tests__/behavioral/RegisteringGlobalEvents.test.js +1 -1
  13. package/build/__tests__/behavioral/RegisteringGlobalEvents.test.js.map +1 -1
  14. package/build/__tests__/behavioral/RegisteringSkillViewOnBoot.test.js +1 -1
  15. package/build/__tests__/behavioral/RegisteringSkillViewOnBoot.test.js.map +1 -1
  16. package/build/__tests__/behavioral/organization/CreatingAnOrg.test.js +1 -1
  17. package/build/__tests__/behavioral/organization/CreatingAnOrg.test.js.map +1 -1
  18. package/build/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.js +1 -1
  19. package/build/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.js.map +1 -1
  20. package/build/__tests__/behavioral/skill/RegisteringASkill.test.d.ts +1 -0
  21. package/build/__tests__/behavioral/skill/RegisteringASkill.test.js +77 -17
  22. package/build/__tests__/behavioral/skill/RegisteringASkill.test.js.map +1 -1
  23. package/build/__tests__/behavioral/views/SettingUpViews.test.js +1 -1
  24. package/build/__tests__/behavioral/views/SettingUpViews.test.js.map +1 -1
  25. package/build/__tests__/implementation/SkillStore.test.js +1 -1
  26. package/build/__tests__/implementation/SkillStore.test.js.map +1 -1
  27. package/build/tests/AbstractCliTest.d.ts +1 -1
  28. package/build/tests/AbstractCliTest.js +9 -5
  29. package/build/tests/AbstractCliTest.js.map +1 -1
  30. package/package.json +29 -29
  31. package/src/__tests__/behavioral/AddingADependency.test.ts +2 -4
  32. package/src/__tests__/behavioral/DeployingToSandbox.test.ts +1 -1
  33. package/src/__tests__/behavioral/InstallingASkillAtAnOrg.test.ts +2 -4
  34. package/src/__tests__/behavioral/LoggingInAsASkill.test.ts +3 -5
  35. package/src/__tests__/behavioral/RegisteringEventsOnBoot.test.ts +1 -3
  36. package/src/__tests__/behavioral/RegisteringGlobalEvents.test.ts +1 -3
  37. package/src/__tests__/behavioral/RegisteringSkillViewOnBoot.test.ts +1 -3
  38. package/src/__tests__/behavioral/organization/CreatingAnOrg.test.ts +1 -1
  39. package/src/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.ts +1 -1
  40. package/src/__tests__/behavioral/skill/RegisteringASkill.test.ts +24 -1
  41. package/src/__tests__/behavioral/views/SettingUpViews.test.ts +1 -1
  42. package/src/__tests__/implementation/SkillStore.test.ts +1 -1
  43. package/src/tests/AbstractCliTest.ts +5 -3
@@ -23,6 +23,8 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
23
23
 
24
24
  var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/helpers/applyDecoratedDescriptor"));
25
25
 
26
+ var _mercuryClient = require("@sprucelabs/mercury-client");
27
+
26
28
  var _spruceEventUtils = require("@sprucelabs/spruce-event-utils");
27
29
 
28
30
  var _test = require("@sprucelabs/test");
@@ -31,13 +33,13 @@ var _testUtils = require("@sprucelabs/test-utils");
31
33
 
32
34
  var _AbstractCliTest2 = _interopRequireDefault(require("../../../tests/AbstractCliTest"));
33
35
 
34
- var _dec, _dec2, _dec3, _class;
36
+ var _dec, _dec2, _dec3, _dec4, _class;
35
37
 
36
38
  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); }; }
37
39
 
38
40
  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; } }
39
41
 
40
- var RegisteringASkillTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), _dec3 = (0, _test.test)(), (_class = /*#__PURE__*/function (_AbstractCliTest) {
42
+ var RegisteringASkillTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), _dec3 = (0, _test.test)(), _dec4 = (0, _test.test)(), (_class = /*#__PURE__*/function (_AbstractCliTest) {
41
43
  (0, _inherits2["default"])(RegisteringASkillTest, _AbstractCliTest);
42
44
 
43
45
  var _super = _createSuper(RegisteringASkillTest);
@@ -113,35 +115,93 @@ var RegisteringASkillTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)()
113
115
 
114
116
  return cantRegisterWithoutBeingLoggedIn;
115
117
  }()
118
+ }, {
119
+ key: "returnsErrorWhenRegistrationFails",
120
+ value: function () {
121
+ var _returnsErrorWhenRegistrationFails = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
122
+ var slug, client, results;
123
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
124
+ while (1) {
125
+ switch (_context3.prev = _context3.next) {
126
+ case 0:
127
+ _mercuryClient.MercuryClientFactory.setIsTestMode(true);
128
+
129
+ _context3.next = 3;
130
+ return this.people.loginAsDemoPerson();
131
+
132
+ case 3:
133
+ _context3.next = 5;
134
+ return this.FeatureFixture().installCachedFeatures('skills');
135
+
136
+ case 5:
137
+ slug = "my-new-skill-".concat(new Date().getTime());
138
+ _context3.next = 8;
139
+ return this.connectToApi();
140
+
141
+ case 8:
142
+ client = _context3.sent;
143
+ _context3.next = 11;
144
+ return client.on('register-skill::v2020_12_25', function () {
145
+ _test.assert.fail('what the!!??');
146
+ });
147
+
148
+ case 11:
149
+ _context3.next = 13;
150
+ return this.Action('skill', 'register').execute({
151
+ nameReadable: 'My great skill',
152
+ nameKebab: slug
153
+ });
154
+
155
+ case 13:
156
+ results = _context3.sent;
157
+
158
+ _test.assert.isTruthy(results.errors);
159
+
160
+ _test.assert.doesInclude(results.errors[0].message, 'what the!!??');
161
+
162
+ case 16:
163
+ case "end":
164
+ return _context3.stop();
165
+ }
166
+ }
167
+ }, _callee3, this);
168
+ }));
169
+
170
+ function returnsErrorWhenRegistrationFails() {
171
+ return _returnsErrorWhenRegistrationFails.apply(this, arguments);
172
+ }
173
+
174
+ return returnsErrorWhenRegistrationFails;
175
+ }()
116
176
  }, {
117
177
  key: "canRegisterSkill",
118
178
  value: function () {
119
- var _canRegisterSkill = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
179
+ var _canRegisterSkill = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
120
180
  var _results$meta;
121
181
 
122
182
  var slug, results, skill, client, getSkillResults, _eventResponseUtil$ge, getSkill, auth, currentSkill;
123
183
 
124
- return _regenerator["default"].wrap(function _callee3$(_context3) {
184
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
125
185
  while (1) {
126
- switch (_context3.prev = _context3.next) {
186
+ switch (_context4.prev = _context4.next) {
127
187
  case 0:
128
- _context3.next = 2;
188
+ _context4.next = 2;
129
189
  return this.FeatureFixture().installCachedFeatures('skills');
130
190
 
131
191
  case 2:
132
- _context3.next = 4;
133
- return this.getPersonFixture().loginAsDemoPerson();
192
+ _context4.next = 4;
193
+ return this.people.loginAsDemoPerson();
134
194
 
135
195
  case 4:
136
196
  slug = "my-new-skill-".concat(new Date().getTime());
137
- _context3.next = 7;
197
+ _context4.next = 7;
138
198
  return this.Action('skill', 'register').execute({
139
199
  nameReadable: 'my new skill',
140
200
  nameKebab: slug
141
201
  });
142
202
 
143
203
  case 7:
144
- results = _context3.sent;
204
+ results = _context4.sent;
145
205
 
146
206
  _test.assert.isFalsy(results.errors);
147
207
 
@@ -149,12 +209,12 @@ var RegisteringASkillTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)()
149
209
 
150
210
  _test.assert.isTruthy(skill);
151
211
 
152
- _context3.next = 13;
212
+ _context4.next = 13;
153
213
  return this.connectToApi();
154
214
 
155
215
  case 13:
156
- client = _context3.sent;
157
- _context3.next = 16;
216
+ client = _context4.sent;
217
+ _context4.next = 16;
158
218
  return client.emit('get-skill::v2020_12_25', {
159
219
  target: {
160
220
  skillId: skill.id
@@ -162,7 +222,7 @@ var RegisteringASkillTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)()
162
222
  });
163
223
 
164
224
  case 16:
165
- getSkillResults = _context3.sent;
225
+ getSkillResults = _context4.sent;
166
226
  _eventResponseUtil$ge = _spruceEventUtils.eventResponseUtil.getFirstResponseOrThrow(getSkillResults), getSkill = _eventResponseUtil$ge.skill;
167
227
 
168
228
  _test.assert.isEqual(skill.id, getSkill.id);
@@ -178,10 +238,10 @@ var RegisteringASkillTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)()
178
238
 
179
239
  case 24:
180
240
  case "end":
181
- return _context3.stop();
241
+ return _context4.stop();
182
242
  }
183
243
  }
184
- }, _callee3, this);
244
+ }, _callee4, this);
185
245
  }));
186
246
 
187
247
  function canRegisterSkill() {
@@ -192,6 +252,6 @@ var RegisteringASkillTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)()
192
252
  }()
193
253
  }]);
194
254
  return RegisteringASkillTest;
195
- }(_AbstractCliTest2["default"]), ((0, _applyDecoratedDescriptor2["default"])(_class, "hasRegisterAction", [_dec], Object.getOwnPropertyDescriptor(_class, "hasRegisterAction"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "cantRegisterWithoutBeingLoggedIn", [_dec2], Object.getOwnPropertyDescriptor(_class, "cantRegisterWithoutBeingLoggedIn"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "canRegisterSkill", [_dec3], Object.getOwnPropertyDescriptor(_class, "canRegisterSkill"), _class)), _class));
255
+ }(_AbstractCliTest2["default"]), ((0, _applyDecoratedDescriptor2["default"])(_class, "hasRegisterAction", [_dec], Object.getOwnPropertyDescriptor(_class, "hasRegisterAction"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "cantRegisterWithoutBeingLoggedIn", [_dec2], Object.getOwnPropertyDescriptor(_class, "cantRegisterWithoutBeingLoggedIn"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "returnsErrorWhenRegistrationFails", [_dec3], Object.getOwnPropertyDescriptor(_class, "returnsErrorWhenRegistrationFails"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "canRegisterSkill", [_dec4], Object.getOwnPropertyDescriptor(_class, "canRegisterSkill"), _class)), _class));
196
256
  exports["default"] = RegisteringASkillTest;
197
257
  //# sourceMappingURL=RegisteringASkill.test.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/__tests__/behavioral/skill/RegisteringASkill.test.ts"],"names":["RegisteringASkillTest","assert","isFunction","Action","execute","FeatureFixture","installCachedFeatures","nameReadable","nameKebab","results","isTruthy","errors","errorAssertUtil","assertError","options","responseErrors","getPersonFixture","loginAsDemoPerson","slug","Date","getTime","isFalsy","skill","meta","connectToApi","client","emit","target","skillId","id","getSkillResults","eventResponseUtil","getFirstResponseOrThrow","getSkill","isEqual","auth","Service","currentSkill","getCurrentSkill","name","AbstractCliTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;IAE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E9DC,kBAAAA,SAAS,EAAEU;AAFmD,iBAAzC,CANvB;;AAAA;AAMOT,gBAAAA,OANP;;AAWCR,6BAAOoB,OAAP,CAAeZ,OAAO,CAACE,MAAvB;;AACMW,gBAAAA,KAZP,oBAYeb,OAAO,CAACc,IAZvB,kDAYe,cAAcD,KAZ7B;;AAaCrB,6BAAOS,QAAP,CAAgBY,KAAhB;;AAbD;AAAA,uBAesB,KAAKE,YAAL,EAftB;;AAAA;AAeOC,gBAAAA,MAfP;AAAA;AAAA,uBAgB+BA,MAAM,CAACC,IAAP,CAAY,wBAAZ,EAAsC;AACnEC,kBAAAA,MAAM,EAAE;AAAEC,oBAAAA,OAAO,EAAEN,KAAK,CAACO;AAAjB;AAD2D,iBAAtC,CAhB/B;;AAAA;AAgBOC,gBAAAA,eAhBP;AAAA,wCAqBEC,oCAAkBC,uBAAlB,CAA0CF,eAA1C,CArBF,EAoBgBG,QApBhB,yBAoBSX,KApBT;;AAuBCrB,6BAAOiC,OAAP,CAAeZ,KAAK,CAACO,EAArB,EAAyBI,QAAQ,CAACJ,EAAlC;;AAEMM,gBAAAA,IAzBP,GAyBc,KAAKC,OAAL,CAAa,MAAb,CAzBd;AA0BOC,gBAAAA,YA1BP,GA0BsBF,IAAI,CAACG,eAAL,EA1BtB;;AA4BCrC,6BAAOS,QAAP,CAAgB2B,YAAhB;;AACApC,6BAAOiC,OAAP,CAAeG,YAAY,CAACE,IAA5B,EAAkC,cAAlC;;AACAtC,6BAAOiC,OAAP,CAAeG,YAAY,CAACnB,IAA5B,EAAkCA,IAAlC;;AA9BD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EAvBkDsB,4B","sourcesContent":["import { eventResponseUtil } from '@sprucelabs/spruce-event-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport { errorAssertUtil } from '@sprucelabs/test-utils'\nimport AbstractCliTest from '../../../tests/AbstractCliTest'\n\nexport default class RegisteringASkillTest extends AbstractCliTest {\n\t@test()\n\tprotected static async hasRegisterAction() {\n\t\tassert.isFunction(this.Action('skill', 'register').execute)\n\t}\n\n\t@test()\n\tprotected static async cantRegisterWithoutBeingLoggedIn() {\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\n\t\tconst results = await this.Action('skill', 'register').execute({\n\t\t\tnameReadable: 'My great skill',\n\t\t\tnameKebab: 'my-great-skill',\n\t\t})\n\n\t\tassert.isTruthy(results.errors)\n\t\terrorAssertUtil.assertError(results.errors[0], 'MERCURY_RESPONSE_ERROR')\n\t\terrorAssertUtil.assertError(\n\t\t\tresults.errors[0].options.responseErrors[0],\n\t\t\t'UNAUTHORIZED_ACCESS'\n\t\t)\n\t}\n\n\t@test()\n\tprotected static async canRegisterSkill() {\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\t\tawait this.getPersonFixture().loginAsDemoPerson()\n\n\t\tconst slug = `my-new-skill-${new Date().getTime()}`\n\t\tconst results = await this.Action('skill', 'register').execute({\n\t\t\tnameReadable: 'my new skill',\n\t\t\tnameKebab: slug,\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\t\tconst skill = results.meta?.skill\n\t\tassert.isTruthy(skill)\n\n\t\tconst client = await this.connectToApi()\n\t\tconst getSkillResults = await client.emit('get-skill::v2020_12_25', {\n\t\t\ttarget: { skillId: skill.id },\n\t\t})\n\n\t\tconst { skill: getSkill } =\n\t\t\teventResponseUtil.getFirstResponseOrThrow(getSkillResults)\n\n\t\tassert.isEqual(skill.id, getSkill.id)\n\n\t\tconst auth = this.Service('auth')\n\t\tconst currentSkill = auth.getCurrentSkill()\n\n\t\tassert.isTruthy(currentSkill)\n\t\tassert.isEqual(currentSkill.name, 'my new skill')\n\t\tassert.isEqual(currentSkill.slug, slug)\n\t}\n}\n"],"file":"RegisteringASkill.test.js"}
1
+ {"version":3,"sources":["../../../../src/__tests__/behavioral/skill/RegisteringASkill.test.ts"],"names":["RegisteringASkillTest","assert","isFunction","Action","execute","FeatureFixture","installCachedFeatures","nameReadable","nameKebab","results","isTruthy","errors","errorAssertUtil","assertError","options","responseErrors","MercuryClientFactory","setIsTestMode","people","loginAsDemoPerson","slug","Date","getTime","connectToApi","client","on","fail","doesInclude","message","isFalsy","skill","meta","emit","target","skillId","id","getSkillResults","eventResponseUtil","getFirstResponseOrThrow","getSkill","isEqual","auth","Service","currentSkill","getCurrentSkill","name","AbstractCliTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,qB,WACnB,iB,UAKA,iB,UAiBA,iB,UAsBA,iB;;;;;;;;;;;;;6GA5CD;AAAA;AAAA;AAAA;AAAA;AAECC,6BAAOC,UAAP,CAAkB,KAAKC,MAAL,CAAY,OAAZ,EAAqB,UAArB,EAAiCC,OAAnD;;AAFD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;4HAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEO,KAAKC,cAAL,GAAsBC,qBAAtB,CAA4C,QAA5C,CAFP;;AAAA;AAAA;AAAA,uBAIuB,KAAKH,MAAL,CAAY,OAAZ,EAAqB,UAArB,EAAiCC,OAAjC,CAAyC;AAC9DG,kBAAAA,YAAY,EAAE,gBADgD;AAE9DC,kBAAAA,SAAS,EAAE;AAFmD,iBAAzC,CAJvB;;AAAA;AAIOC,gBAAAA,OAJP;;AASCR,6BAAOS,QAAP,CAAgBD,OAAO,CAACE,MAAxB;;AACAC,2CAAgBC,WAAhB,CAA4BJ,OAAO,CAACE,MAAR,CAAe,CAAf,CAA5B,EAA+C,wBAA/C;;AACAC,2CAAgBC,WAAhB,CACCJ,OAAO,CAACE,MAAR,CAAe,CAAf,EAAkBG,OAAlB,CAA0BC,cAA1B,CAAyC,CAAzC,CADD,EAEC,qBAFD;;AAXD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;6HAiBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAECC,oDAA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BAAzC,CANvB;;AAAA;AAMOX,gBAAAA,OANP;;AAWCR,6BAAO4B,OAAP,CAAepB,OAAO,CAACE,MAAvB;;AACMmB,gBAAAA,KAZP,oBAYerB,OAAO,CAACsB,IAZvB,kDAYe,cAAcD,KAZ7B;;AAaC7B,6BAAOS,QAAP,CAAgBoB,KAAhB;;AAbD;AAAA,uBAesB,KAAKP,YAAL,EAftB;;AAAA;AAeOC,gBAAAA,MAfP;AAAA;AAAA,uBAgB+BA,MAAM,CAACQ,IAAP,CAAY,wBAAZ,EAAsC;AACnEC,kBAAAA,MAAM,EAAE;AAAEC,oBAAAA,OAAO,EAAEJ,KAAK,CAACK;AAAjB;AAD2D,iBAAtC,CAhB/B;;AAAA;AAgBOC,gBAAAA,eAhBP;AAAA,wCAqBEC,oCAAkBC,uBAAlB,CAA0CF,eAA1C,CArBF,EAoBgBG,QApBhB,yBAoBST,KApBT;;AAuBC7B,6BAAOuC,OAAP,CAAeV,KAAK,CAACK,EAArB,EAAyBI,QAAQ,CAACJ,EAAlC;;AAEMM,gBAAAA,IAzBP,GAyBc,KAAKC,OAAL,CAAa,MAAb,CAzBd;AA0BOC,gBAAAA,YA1BP,GA0BsBF,IAAI,CAACG,eAAL,EA1BtB;;AA4BC3C,6BAAOS,QAAP,CAAgBiC,YAAhB;;AACA1C,6BAAOuC,OAAP,CAAeG,YAAY,CAACE,IAA5B,EAAkC,cAAlC;;AACA5C,6BAAOuC,OAAP,CAAeG,YAAY,CAACvB,IAA5B,EAAkCA,IAAlC;;AA9BD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EA7CkD0B,4B","sourcesContent":["import { MercuryClientFactory } from '@sprucelabs/mercury-client'\nimport { eventResponseUtil } from '@sprucelabs/spruce-event-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport { errorAssertUtil } from '@sprucelabs/test-utils'\nimport AbstractCliTest from '../../../tests/AbstractCliTest'\n\nexport default class RegisteringASkillTest extends AbstractCliTest {\n\t@test()\n\tprotected static async hasRegisterAction() {\n\t\tassert.isFunction(this.Action('skill', 'register').execute)\n\t}\n\n\t@test()\n\tprotected static async cantRegisterWithoutBeingLoggedIn() {\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\n\t\tconst results = await this.Action('skill', 'register').execute({\n\t\t\tnameReadable: 'My great skill',\n\t\t\tnameKebab: 'my-great-skill',\n\t\t})\n\n\t\tassert.isTruthy(results.errors)\n\t\terrorAssertUtil.assertError(results.errors[0], 'MERCURY_RESPONSE_ERROR')\n\t\terrorAssertUtil.assertError(\n\t\t\tresults.errors[0].options.responseErrors[0],\n\t\t\t'UNAUTHORIZED_ACCESS'\n\t\t)\n\t}\n\n\t@test()\n\tprotected static async returnsErrorWhenRegistrationFails() {\n\t\tMercuryClientFactory.setIsTestMode(true)\n\n\t\tawait this.people.loginAsDemoPerson()\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\t\tconst slug = `my-new-skill-${new Date().getTime()}`\n\n\t\tconst client = await this.connectToApi()\n\t\tawait client.on('register-skill::v2020_12_25', (() => {\n\t\t\tassert.fail('what the!!??')\n\t\t}) as any)\n\n\t\tconst results = await this.Action('skill', 'register').execute({\n\t\t\tnameReadable: 'My great skill',\n\t\t\tnameKebab: slug,\n\t\t})\n\n\t\tassert.isTruthy(results.errors)\n\t\tassert.doesInclude(results.errors[0].message, 'what the!!??')\n\t}\n\n\t@test()\n\tprotected static async canRegisterSkill() {\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\t\tawait this.people.loginAsDemoPerson()\n\n\t\tconst slug = `my-new-skill-${new Date().getTime()}`\n\t\tconst results = await this.Action('skill', 'register').execute({\n\t\t\tnameReadable: 'my new skill',\n\t\t\tnameKebab: slug,\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\t\tconst skill = results.meta?.skill\n\t\tassert.isTruthy(skill)\n\n\t\tconst client = await this.connectToApi()\n\t\tconst getSkillResults = await client.emit('get-skill::v2020_12_25', {\n\t\t\ttarget: { skillId: skill.id },\n\t\t})\n\n\t\tconst { skill: getSkill } =\n\t\t\teventResponseUtil.getFirstResponseOrThrow(getSkillResults)\n\n\t\tassert.isEqual(skill.id, getSkill.id)\n\n\t\tconst auth = this.Service('auth')\n\t\tconst currentSkill = auth.getCurrentSkill()\n\n\t\tassert.isTruthy(currentSkill)\n\t\tassert.isEqual(currentSkill.name, 'my new skill')\n\t\tassert.isEqual(currentSkill.slug, slug)\n\t}\n}\n"],"file":"RegisteringASkill.test.js"}
@@ -97,7 +97,7 @@ var SettingUpViewsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), (
97
97
 
98
98
  case 2:
99
99
  _context2.next = 4;
100
- return this.getPersonFixture().loginAsDemoPerson();
100
+ return this.people.loginAsDemoPerson();
101
101
 
102
102
  case 4:
103
103
  dependencies = this.Service('dependency').get();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/__tests__/behavioral/views/SettingUpViews.test.ts"],"names":["SettingUpViewsTest","Cli","cli","feature","getFeature","assert","isTruthy","FeatureFixture","installFeatures","code","options","name","description","getPersonFixture","loginAsDemoPerson","dependencies","Service","get","isLength","isEqual","namespace","AbstractCliTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;;;IAEqBA,kB,WACnB,iB,UAOA,iB;;;;;;;;;;;;;6GAPD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEmB,KAAKC,GAAL,EAFnB;;AAAA;AAEOC,gBAAAA,GAFP;AAGOC,gBAAAA,OAHP,GAGiBD,GAAG,CAACE,UAAJ,CAAe,MAAf,CAHjB;;AAICC,6BAAOC,QAAP,CAAgBH,OAAhB;;AAJD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;oIAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEO,KAAKI,cAAL,GAAsBC,eAAtB,CAAsC,CAC3C;AACCC,kBAAAA,IAAI,EAAE,OADP;AAECC,kBAAAA,OAAO,EAAE;AACRC,oBAAAA,IAAI,EAAE,eADE;AAERC,oBAAAA,WAAW,EAAE;AAFL;AAFV,iBAD2C,EAQ3C;AACCH,kBAAAA,IAAI,EAAE;AADP,iBAR2C,CAAtC,CAFP;;AAAA;AAAA;AAAA,uBAeO,KAAKI,gBAAL,GAAwBC,iBAAxB,EAfP;;AAAA;AAiBOC,gBAAAA,YAjBP,GAiBsB,KAAKC,OAAL,CAAa,YAAb,EAA2BC,GAA3B,EAjBtB;;AAkBCZ,6BAAOa,QAAP,CAAgBH,YAAhB,EAA8B,CAA9B;;AAEAV,6BAAOc,OAAP,CAAeJ,YAAY,CAAC,CAAD,CAAZ,CAAgBK,SAA/B,EAA0C,WAA1C;;AApBD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EAR+CC,4B","sourcesContent":["import { test, assert } from '@sprucelabs/test'\nimport AbstractCliTest from '../../../tests/AbstractCliTest'\n\nexport default class SettingUpViewsTest extends AbstractCliTest {\n\t@test()\n\tprotected static async canGetViewFeature() {\n\t\tconst cli = await this.Cli()\n\t\tconst feature = cli.getFeature('view')\n\t\tassert.isTruthy(feature)\n\t}\n\n\t@test()\n\tprotected static async installingViewsAddsHeartwoodAsDependency() {\n\t\tawait this.FeatureFixture().installFeatures([\n\t\t\t{\n\t\t\t\tcode: 'skill',\n\t\t\t\toptions: {\n\t\t\t\t\tname: 'testing views',\n\t\t\t\t\tdescription: 'this too, is a great test!',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tcode: 'view',\n\t\t\t},\n\t\t])\n\n\t\tawait this.getPersonFixture().loginAsDemoPerson()\n\n\t\tconst dependencies = this.Service('dependency').get()\n\t\tassert.isLength(dependencies, 1)\n\n\t\tassert.isEqual(dependencies[0].namespace, 'heartwood')\n\t}\n}\n"],"file":"SettingUpViews.test.js"}
1
+ {"version":3,"sources":["../../../../src/__tests__/behavioral/views/SettingUpViews.test.ts"],"names":["SettingUpViewsTest","Cli","cli","feature","getFeature","assert","isTruthy","FeatureFixture","installFeatures","code","options","name","description","people","loginAsDemoPerson","dependencies","Service","get","isLength","isEqual","namespace","AbstractCliTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;;;IAEqBA,kB,WACnB,iB,UAOA,iB;;;;;;;;;;;;;6GAPD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEmB,KAAKC,GAAL,EAFnB;;AAAA;AAEOC,gBAAAA,GAFP;AAGOC,gBAAAA,OAHP,GAGiBD,GAAG,CAACE,UAAJ,CAAe,MAAf,CAHjB;;AAICC,6BAAOC,QAAP,CAAgBH,OAAhB;;AAJD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;oIAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEO,KAAKI,cAAL,GAAsBC,eAAtB,CAAsC,CAC3C;AACCC,kBAAAA,IAAI,EAAE,OADP;AAECC,kBAAAA,OAAO,EAAE;AACRC,oBAAAA,IAAI,EAAE,eADE;AAERC,oBAAAA,WAAW,EAAE;AAFL;AAFV,iBAD2C,EAQ3C;AACCH,kBAAAA,IAAI,EAAE;AADP,iBAR2C,CAAtC,CAFP;;AAAA;AAAA;AAAA,uBAeO,KAAKI,MAAL,CAAYC,iBAAZ,EAfP;;AAAA;AAiBOC,gBAAAA,YAjBP,GAiBsB,KAAKC,OAAL,CAAa,YAAb,EAA2BC,GAA3B,EAjBtB;;AAkBCZ,6BAAOa,QAAP,CAAgBH,YAAhB,EAA8B,CAA9B;;AAEAV,6BAAOc,OAAP,CAAeJ,YAAY,CAAC,CAAD,CAAZ,CAAgBK,SAA/B,EAA0C,WAA1C;;AApBD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EAR+CC,4B","sourcesContent":["import { test, assert } from '@sprucelabs/test'\nimport AbstractCliTest from '../../../tests/AbstractCliTest'\n\nexport default class SettingUpViewsTest extends AbstractCliTest {\n\t@test()\n\tprotected static async canGetViewFeature() {\n\t\tconst cli = await this.Cli()\n\t\tconst feature = cli.getFeature('view')\n\t\tassert.isTruthy(feature)\n\t}\n\n\t@test()\n\tprotected static async installingViewsAddsHeartwoodAsDependency() {\n\t\tawait this.FeatureFixture().installFeatures([\n\t\t\t{\n\t\t\t\tcode: 'skill',\n\t\t\t\toptions: {\n\t\t\t\t\tname: 'testing views',\n\t\t\t\t\tdescription: 'this too, is a great test!',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tcode: 'view',\n\t\t\t},\n\t\t])\n\n\t\tawait this.people.loginAsDemoPerson()\n\n\t\tconst dependencies = this.Service('dependency').get()\n\t\tassert.isLength(dependencies, 1)\n\n\t\tassert.isEqual(dependencies[0].namespace, 'heartwood')\n\t}\n}\n"],"file":"SettingUpViews.test.js"}
@@ -298,7 +298,7 @@ var SkillStoreTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), _dec3
298
298
  case 2:
299
299
  slug = "awesome-skill-".concat(new Date().getTime());
300
300
  _context8.next = 5;
301
- return this.getPersonFixture().loginAsDemoPerson();
301
+ return this.people.loginAsDemoPerson();
302
302
 
303
303
  case 5:
304
304
  skillStore = this.Store('skill');
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/__tests__/implementation/SkillStore.test.ts"],"names":["SkillStoreTest","assert","isTruthy","Store","isFunction","register","doesThrowAsync","name","slug","err","errorAssertUtil","assertError","loadCurrentSkill","isCurrentSkillRegistered","FeatureFixture","installCachedFeatures","loadCurrentSkillsNamespace","namespace","isEqual","store","setCurrentSkillsNamespace","Date","getTime","getPersonFixture","loginAsDemoPerson","skillStore","isRegistered","isFalse","skill","isString","apiKey","id","connectToApi","client","authenticate","skillId","results","isTrue","currentSkill","env","Service","get","pkg","AbstractCliTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;IAEqBA,c,WACnB,iB,UAKA,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AAAA,YAlCP;;AAoCCrC,6BAAOiB,OAAP,CAAeoB,YAAY,CAACP,EAA5B,EAAgCH,KAAK,CAACG,EAAtC;;AACA9B,6BAAOoC,MAAP,CAAcC,YAAY,CAACZ,YAA3B;;AACAzB,6BAAOiB,OAAP,CAAeoB,YAAY,CAAC/B,IAA5B,EAAkC,eAAlC;;AACAN,6BAAOiB,OAAP,CAAeoB,YAAY,CAAC9B,IAA5B,EAAkCA,IAAlC;;AACAP,6BAAOiB,OAAP,CAAeoB,YAAY,CAACR,MAA5B,EAAoCF,KAAK,CAACE,MAA1C;;AAEMS,gBAAAA,GA1CP,GA0Ca,KAAKC,OAAL,CAAa,KAAb,CA1Cb;;AA4CCvC,6BAAOiB,OAAP,CAAeqB,GAAG,CAACE,GAAJ,CAAQ,UAAR,CAAf,EAAoCb,KAAK,CAACG,EAA1C;;AACA9B,6BAAOiB,OAAP,CAAeqB,GAAG,CAACE,GAAJ,CAAQ,eAAR,CAAf,EAAyCb,KAAK,CAACE,MAA/C;;AA7CD;AAAA,uBA+CmB7B,aAAOK,cAAP,CAAsB;AAAA,yBACvCmB,UAAU,CAACL,yBAAX,CAAqC,MAArC,CADuC;AAAA,iBAAtB,CA/CnB;;AAAA;AA+COX,gBAAAA,GA/CP;;AAmDCC,2CAAgBC,WAAhB,CAA4BF,GAA5B,EAAiC,SAAjC;;AAEMiC,gBAAAA,GArDP,GAqDa,KAAKF,OAAL,CAAa,KAAb,CArDb;AAsDOvB,gBAAAA,SAtDP,GAsDmByB,GAAG,CAACD,GAAJ,CAAQ,iBAAR,CAtDnB;;AAuDCxC,6BAAOiB,OAAP,CAAeD,SAAf,EAA0BT,IAA1B;;AAvDD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EA3D2CmC,4B","sourcesContent":["import { test, assert } from '@sprucelabs/test'\nimport { errorAssertUtil } from '@sprucelabs/test-utils'\nimport AbstractCliTest from '../../tests/AbstractCliTest'\n\nexport default class SkillStoreTest extends AbstractCliTest {\n\t@test()\n\tprotected static async canInstantiateSkillStore() {\n\t\tassert.isTruthy(this.Store('skill'))\n\t}\n\n\t@test()\n\tprotected static async hasRegisterMethod() {\n\t\tassert.isFunction(this.Store('skill').register)\n\t}\n\n\t@test()\n\tprotected static async cantRegisterIfNotInSkill() {\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tthis.Store('skill').register({\n\t\t\t\tname: 'awesome skill',\n\t\t\t\tslug: 'awesome-skill',\n\t\t\t})\n\t\t)\n\t\terrorAssertUtil.assertError(err, 'DIRECTORY_NOT_SKILL')\n\t}\n\n\t@test()\n\tprotected static async cantLoadcurrentSkillIfNotInSkill() {\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tthis.Store('skill').loadCurrentSkill()\n\t\t)\n\t\terrorAssertUtil.assertError(err, 'DIRECTORY_NOT_SKILL')\n\t}\n\n\t@test()\n\tprotected static async cantCheckIfSkillIsRegisteredNotInSkill() {\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tthis.Store('skill').isCurrentSkillRegistered()\n\t\t)\n\t\terrorAssertUtil.assertError(err, 'DIRECTORY_NOT_SKILL')\n\t}\n\n\t@test()\n\tprotected static async canGetNamespace() {\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\n\t\tconst namespace = await this.Store('skill').loadCurrentSkillsNamespace()\n\t\tassert.isEqual(namespace, 'TestSkill')\n\t}\n\n\t@test()\n\tprotected static async canSetNamespace() {\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\n\t\tconst store = this.Store('skill')\n\t\tlet namespace = await store.loadCurrentSkillsNamespace()\n\n\t\tawait this.Store('skill').setCurrentSkillsNamespace('new-namespace')\n\n\t\tnamespace = await store.loadCurrentSkillsNamespace()\n\t\tassert.isEqual(namespace, 'NewNamespace')\n\t}\n\n\t@test()\n\tprotected static async canRegister() {\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\n\t\tconst slug = `awesome-skill-${new Date().getTime()}`\n\t\tawait this.getPersonFixture().loginAsDemoPerson()\n\n\t\tconst skillStore = this.Store('skill')\n\n\t\tlet isRegistered = await skillStore.isCurrentSkillRegistered()\n\t\tassert.isFalse(isRegistered)\n\n\t\tconst skill = await skillStore.register({\n\t\t\tname: 'awesome skill',\n\t\t\tslug,\n\t\t})\n\n\t\tassert.isTruthy(skill)\n\t\tassert.isEqual(skill.name, 'awesome skill')\n\t\tassert.isEqual(skill.slug, slug)\n\t\tassert.isString(skill.apiKey)\n\t\tassert.isString(skill.id)\n\n\t\tconst client = await this.connectToApi()\n\t\tconst results = await client.authenticate({\n\t\t\tskillId: skill.id,\n\t\t\tapiKey: skill.apiKey,\n\t\t})\n\n\t\tassert.isEqual(results.skill?.id, skill.id)\n\n\t\tisRegistered = await skillStore.isCurrentSkillRegistered()\n\t\tassert.isTrue(isRegistered)\n\n\t\tconst currentSkill = await skillStore.loadCurrentSkill()\n\n\t\tassert.isEqual(currentSkill.id, skill.id)\n\t\tassert.isTrue(currentSkill.isRegistered)\n\t\tassert.isEqual(currentSkill.name, 'awesome skill')\n\t\tassert.isEqual(currentSkill.slug, slug)\n\t\tassert.isEqual(currentSkill.apiKey, skill.apiKey)\n\n\t\tconst env = this.Service('env')\n\n\t\tassert.isEqual(env.get('SKILL_ID'), skill.id)\n\t\tassert.isEqual(env.get('SKILL_API_KEY'), skill.apiKey)\n\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tskillStore.setCurrentSkillsNamespace('test')\n\t\t)\n\n\t\terrorAssertUtil.assertError(err, 'GENERIC')\n\n\t\tconst pkg = this.Service('pkg')\n\t\tconst namespace = pkg.get('skill.namespace')\n\t\tassert.isEqual(namespace, slug)\n\t}\n}\n"],"file":"SkillStore.test.js"}
1
+ {"version":3,"sources":["../../../src/__tests__/implementation/SkillStore.test.ts"],"names":["SkillStoreTest","assert","isTruthy","Store","isFunction","register","doesThrowAsync","name","slug","err","errorAssertUtil","assertError","loadCurrentSkill","isCurrentSkillRegistered","FeatureFixture","installCachedFeatures","loadCurrentSkillsNamespace","namespace","isEqual","store","setCurrentSkillsNamespace","Date","getTime","people","loginAsDemoPerson","skillStore","isRegistered","isFalse","skill","isString","apiKey","id","connectToApi","client","authenticate","skillId","results","isTrue","currentSkill","env","Service","get","pkg","AbstractCliTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;IAEqBA,c,WACnB,iB,UAKA,iB,UAKA,iB,UAWA,iB,UAQA,iB,UAQA,iB,UAQA,iB,UAaA,iB;;;;;;;;;;;;;oHA1DD;AAAA;AAAA;AAAA;AAAA;AAECC,6BAAOC,QAAP,CAAgB,KAAKC,KAAL,CAAW,OAAX,CAAhB;;AAFD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;6GAKA;AAAA;AAAA;AAAA;AAAA;AAECF,6BAAOG,UAAP,CAAkB,KAAKD,KAAL,CAAW,OAAX,EAAoBE,QAAtC;;AAFD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;oHAKA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEmBJ,aAAOK,cAAP,CAAsB;AAAA,yBACvC,KAAI,CAACH,KAAL,CAAW,OAAX,EAAoBE,QAApB,CAA6B;AAC5BE,oBAAAA,IAAI,EAAE,eADsB;AAE5BC,oBAAAA,IAAI,EAAE;AAFsB,mBAA7B,CADuC;AAAA,iBAAtB,CAFnB;;AAAA;AAEOC,gBAAAA,GAFP;;AAQCC,2CAAgBC,WAAhB,CAA4BF,GAA5B,EAAiC,qBAAjC;;AARD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;4HAWA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEmBR,aAAOK,cAAP,CAAsB;AAAA,yBACvC,MAAI,CAACH,KAAL,CAAW,OAAX,EAAoBS,gBAApB,EADuC;AAAA,iBAAtB,CAFnB;;AA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AAR,CAtDnB;;AAuDCxC,6BAAOiB,OAAP,CAAeD,SAAf,EAA0BT,IAA1B;;AAvDD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EA3D2CmC,4B","sourcesContent":["import { test, assert } from '@sprucelabs/test'\nimport { errorAssertUtil } from '@sprucelabs/test-utils'\nimport AbstractCliTest from '../../tests/AbstractCliTest'\n\nexport default class SkillStoreTest extends AbstractCliTest {\n\t@test()\n\tprotected static async canInstantiateSkillStore() {\n\t\tassert.isTruthy(this.Store('skill'))\n\t}\n\n\t@test()\n\tprotected static async hasRegisterMethod() {\n\t\tassert.isFunction(this.Store('skill').register)\n\t}\n\n\t@test()\n\tprotected static async cantRegisterIfNotInSkill() {\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tthis.Store('skill').register({\n\t\t\t\tname: 'awesome skill',\n\t\t\t\tslug: 'awesome-skill',\n\t\t\t})\n\t\t)\n\t\terrorAssertUtil.assertError(err, 'DIRECTORY_NOT_SKILL')\n\t}\n\n\t@test()\n\tprotected static async cantLoadcurrentSkillIfNotInSkill() {\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tthis.Store('skill').loadCurrentSkill()\n\t\t)\n\t\terrorAssertUtil.assertError(err, 'DIRECTORY_NOT_SKILL')\n\t}\n\n\t@test()\n\tprotected static async cantCheckIfSkillIsRegisteredNotInSkill() {\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tthis.Store('skill').isCurrentSkillRegistered()\n\t\t)\n\t\terrorAssertUtil.assertError(err, 'DIRECTORY_NOT_SKILL')\n\t}\n\n\t@test()\n\tprotected static async canGetNamespace() {\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\n\t\tconst namespace = await this.Store('skill').loadCurrentSkillsNamespace()\n\t\tassert.isEqual(namespace, 'TestSkill')\n\t}\n\n\t@test()\n\tprotected static async canSetNamespace() {\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\n\t\tconst store = this.Store('skill')\n\t\tlet namespace = await store.loadCurrentSkillsNamespace()\n\n\t\tawait this.Store('skill').setCurrentSkillsNamespace('new-namespace')\n\n\t\tnamespace = await store.loadCurrentSkillsNamespace()\n\t\tassert.isEqual(namespace, 'NewNamespace')\n\t}\n\n\t@test()\n\tprotected static async canRegister() {\n\t\tawait this.FeatureFixture().installCachedFeatures('skills')\n\n\t\tconst slug = `awesome-skill-${new Date().getTime()}`\n\t\tawait this.people.loginAsDemoPerson()\n\n\t\tconst skillStore = this.Store('skill')\n\n\t\tlet isRegistered = await skillStore.isCurrentSkillRegistered()\n\t\tassert.isFalse(isRegistered)\n\n\t\tconst skill = await skillStore.register({\n\t\t\tname: 'awesome skill',\n\t\t\tslug,\n\t\t})\n\n\t\tassert.isTruthy(skill)\n\t\tassert.isEqual(skill.name, 'awesome skill')\n\t\tassert.isEqual(skill.slug, slug)\n\t\tassert.isString(skill.apiKey)\n\t\tassert.isString(skill.id)\n\n\t\tconst client = await this.connectToApi()\n\t\tconst results = await client.authenticate({\n\t\t\tskillId: skill.id,\n\t\t\tapiKey: skill.apiKey,\n\t\t})\n\n\t\tassert.isEqual(results.skill?.id, skill.id)\n\n\t\tisRegistered = await skillStore.isCurrentSkillRegistered()\n\t\tassert.isTrue(isRegistered)\n\n\t\tconst currentSkill = await skillStore.loadCurrentSkill()\n\n\t\tassert.isEqual(currentSkill.id, skill.id)\n\t\tassert.isTrue(currentSkill.isRegistered)\n\t\tassert.isEqual(currentSkill.name, 'awesome skill')\n\t\tassert.isEqual(currentSkill.slug, slug)\n\t\tassert.isEqual(currentSkill.apiKey, skill.apiKey)\n\n\t\tconst env = this.Service('env')\n\n\t\tassert.isEqual(env.get('SKILL_ID'), skill.id)\n\t\tassert.isEqual(env.get('SKILL_API_KEY'), skill.apiKey)\n\n\t\tconst err = await assert.doesThrowAsync(() =>\n\t\t\tskillStore.setCurrentSkillsNamespace('test')\n\t\t)\n\n\t\terrorAssertUtil.assertError(err, 'GENERIC')\n\n\t\tconst pkg = this.Service('pkg')\n\t\tconst namespace = pkg.get('skill.namespace')\n\t\tassert.isEqual(namespace, slug)\n\t}\n}\n"],"file":"SkillStore.test.js"}
@@ -48,7 +48,7 @@ export default abstract class AbstractCliTest extends AbstractSpruceTest {
48
48
  protected static ServiceFactory(): ServiceFactory;
49
49
  protected static FeatureFixture(options?: Partial<FeatureFixtureOptions>): FeatureFixture;
50
50
  protected static getMercuryFixture(): MercuryFixture;
51
- protected static getPersonFixture(): PersonFixture;
51
+ protected static get people(): PersonFixture;
52
52
  protected static getViewFixture(): ViewFixture;
53
53
  private static WriterFactory;
54
54
  protected static skipInstallSkillPrompts<E extends () => Promise<FeatureActionResponse>>(execute?: E): Promise<E extends undefined ? undefined : FeatureActionResponse>;
@@ -29,6 +29,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
29
29
 
30
30
  var _path = _interopRequireDefault(require("path"));
31
31
 
32
+ var _mercuryClient = require("@sprucelabs/mercury-client");
33
+
32
34
  var _schema = require("@sprucelabs/schema");
33
35
 
34
36
  var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
@@ -194,7 +196,9 @@ var AbstractCliTest = /*#__PURE__*/function (_AbstractSpruceTest) {
194
196
 
195
197
  _CommandService["default"].clearMockResponses();
196
198
 
197
- case 18:
199
+ _mercuryClient.MercuryClientFactory.reset();
200
+
201
+ case 19:
198
202
  case "end":
199
203
  return _context2.stop();
200
204
  }
@@ -484,8 +488,8 @@ var AbstractCliTest = /*#__PURE__*/function (_AbstractSpruceTest) {
484
488
  return this.mercuryFixture;
485
489
  }
486
490
  }, {
487
- key: "getPersonFixture",
488
- value: function getPersonFixture() {
491
+ key: "people",
492
+ get: function get() {
489
493
  if (!this.personFixture) {
490
494
  this.personFixture = new _PersonFixture["default"](this.getMercuryFixture().getApiClientFactory());
491
495
  }
@@ -565,7 +569,7 @@ var AbstractCliTest = /*#__PURE__*/function (_AbstractSpruceTest) {
565
569
  key: "getOrganizationFixture",
566
570
  value: function getOrganizationFixture() {
567
571
  if (!this.organizationFixture) {
568
- this.organizationFixture = new _OrganizationFixture["default"](this.getPersonFixture(), this.StoreFactory());
572
+ this.organizationFixture = new _OrganizationFixture["default"](this.people, this.StoreFactory());
569
573
  }
570
574
 
571
575
  return this.organizationFixture;
@@ -574,7 +578,7 @@ var AbstractCliTest = /*#__PURE__*/function (_AbstractSpruceTest) {
574
578
  key: "getSkillFixture",
575
579
  value: function getSkillFixture() {
576
580
  if (!this.skillFixture) {
577
- this.skillFixture = new _SkillFixture["default"](this.getPersonFixture(), this.StoreFactory(), this.getMercuryFixture().getApiClientFactory());
581
+ this.skillFixture = new _SkillFixture["default"](this.people, this.StoreFactory(), this.getMercuryFixture().getApiClientFactory());
578
582
  }
579
583
 
580
584
  return this.skillFixture;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tests/AbstractCliTest.ts"],"names":["AbstractCliTest","cleanTestDirsAndFiles","LintService","disableLinting","ImportService","setCacheDir","diskUtil","createRandomTempDir","enableCaching","process","env","ENABLE_INSTALL_INTERTAINMENT","originalEnv","testUtil","startLogTimer","SchemaRegistry","getInstance","forgetAllSchemas","cwd","freshTmpDir","homeDir","emitter","undefined","featureInstaller","OnboardingStore","overrideCwd","ui","reset","invocations","setCursorPosition","x","y","clearFixtures","clearCache","SkillStore","clearCurrentSkill","EventStore","CommandService","clearMockResponses","organizationFixture","clearAllOrgs","mercuryFixture","disconnectAll","_ui","isWaitingForInput","Error","doesDirExist","shouldClearCache","deleteDir","shouldCleanupTestSkillDirs","FeatureFixture","deleteOldSkillDirs","pattern","resolveTestPath","matches","match","deleteFile","personFixture","skillFixture","viewFixture","tmpDirectory","resolveTestDir","uuid","v4","fs","ensureDirSync","SpyInterface","CliGlobalEmitter","Emitter","pathAfterTestDirsAndFiles","pathUtil","join","cliRoot","options","Cli","fixture","linkLocalPackages","type","sf","ServiceFactory","Service","getEmitter","serviceFactory","apiClientFactory","getMercuryFixture","getApiClientFactory","getFeatureInstaller","MercuryFixture","PersonFixture","writerFactory","WriterFactory","viewWriter","Writer","fileDescriptions","ViewFixture","Action","templates","settings","execute","promise","waitForInput","sendInput","results","OrganizationFixture","getPersonFixture","StoreFactory","SkillFixture","filePath","resolveHashSprucePath","storeFactory","actionExecuter","ActionExecuter","FeatureInstallerFactory","WithAllFeatures","code","Store","isInstalled","assert","isTrue","files","file","checker","check","path","connectToApi","all","dir","wait","timeout","log","featureCode","actionCode","executer","shouldThrowOnListenerError","actionFactory","ActionFactory","optionOverrides","shouldInstallMissingDependencies","featureInstallerFactory","shouldAutoHandleDependencies","label","last","getLastInvocation","doesInclude","choices","find","o","value","AbstractSpruceTest","__dirname"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AAGA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;IAM8BA,e;;;;;;;;;;;;;qGAc7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,uBAEO,KAAKC,qBAAL,EAFP;;AAAA;AAICC,wCAAYC,cAAZ;;AAEAC,0CAAcC,WAAd,CAA0BC,2BAASC,mBAAT,EAA1B;;AACAH,0CAAcI,aAAd;;AAEAC,gBAAAA,OAAO,CAACC,GAAR,CAAYC,4BAAZ,GAA2C,OAA3C;AAEA,qBAAKC,WAAL,qBAAwBH,OAAO,CAACC,GAAhC;;AAXD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;sGAcA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAGC;AACAD,gBAAAA,OAAO,CAACC,GAAR,qBAAmB,KAAKE,WAAxB;;AAEAC,kCAASC,aAAT;;AAEAC,uCAAeC,WAAf,GAA6BC,gBAA7B;;AAEA,qB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,KAAKlH,EAAL,CAAQ2E,SAAR,WAAqB9C,KAAK,CAAC4F,KAA3B,EAAL;AACA;;;EA3aoDC,gB;;;iCAAxBpJ,e,aACFsE,iBAASC,IAAT,CAAc8E,SAAd,EAAyB,IAAzB,C;iCADErJ,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e","sourcesContent":["import pathUtil from 'path'\nimport { SchemaRegistry } from '@sprucelabs/schema'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { templates } from '@sprucelabs/spruce-templates'\nimport AbstractSpruceTest, { assert } from '@sprucelabs/test'\nimport fs from 'fs-extra'\nimport globby from 'globby'\nimport * as uuid from 'uuid'\nimport { CliBootOptions } from '../cli'\nimport AbstractAction from '../features/AbstractAction'\nimport { FeatureOptions } from '../features/AbstractFeature'\nimport ActionExecuter, {\n\tActionExecuterOptions,\n} from '../features/ActionExecuter'\nimport ActionFactory from '../features/ActionFactory'\nimport EventStore from '../features/event/stores/EventStore'\nimport FeatureInstaller from '../features/FeatureInstaller'\nimport FeatureInstallerFactory from '../features/FeatureInstallerFactory'\nimport { FeatureActionResponse, FeatureCode } from '../features/features.types'\nimport OnboardingStore from '../features/onboard/stores/OnboardingStore'\nimport SkillStore from '../features/skill/stores/SkillStore'\nimport CliGlobalEmitter, { GlobalEmitter } from '../GlobalEmitter'\nimport SpyInterface from '../interfaces/SpyInterface'\nimport CommandService from '../services/CommandService'\nimport ImportService from '../services/ImportService'\nimport LintService from '../services/LintService'\nimport ServiceFactory, { Service, ServiceMap } from '../services/ServiceFactory'\nimport StoreFactory, {\n\tStoreCode,\n\tStoreFactoryMethodOptions,\n\tStoreFactoryOptions,\n\tStoreMap,\n} from '../stores/StoreFactory'\nimport { ApiClientFactoryOptions } from '../types/apiClient.types'\nimport { OptionOverrides } from '../types/cli.types'\nimport WriterFactory from '../writers/WriterFactory'\nimport FeatureFixture, {\n\tFeatureFixtureOptions,\n} from './fixtures/FeatureFixture'\nimport MercuryFixture from './fixtures/MercuryFixture'\nimport OrganizationFixture from './fixtures/OrganizationFixture'\nimport PersonFixture from './fixtures/PersonFixture'\nimport SkillFixture from './fixtures/SkillFixture'\nimport ViewFixture from './fixtures/ViewFixture'\nimport testUtil from './utilities/test.utility'\n\ntype ExecuterOptions = Partial<ActionExecuterOptions> & {\n\toptionOverrides?: OptionOverrides\n}\n\nexport default abstract class AbstractCliTest extends AbstractSpruceTest {\n\tprotected static cliRoot = pathUtil.join(__dirname, '..')\n\tprotected static homeDir: string\n\n\tprivate static _ui: SpyInterface\n\tprivate static emitter?: GlobalEmitter\n\tprivate static mercuryFixture?: MercuryFixture\n\tprivate static personFixture?: PersonFixture\n\tprivate static organizationFixture?: OrganizationFixture\n\tprivate static skillFixture?: SkillFixture\n\tprivate static featureInstaller?: FeatureInstaller\n\tprivate static viewFixture?: ViewFixture\n\tprivate static originalEnv: { [x: string]: string | undefined }\n\n\tprotected static async beforeAll() {\n\t\tawait super.beforeAll()\n\t\tawait this.cleanTestDirsAndFiles()\n\n\t\tLintService.disableLinting()\n\n\t\tImportService.setCacheDir(diskUtil.createRandomTempDir())\n\t\tImportService.enableCaching()\n\n\t\tprocess.env.ENABLE_INSTALL_INTERTAINMENT = 'false'\n\n\t\tthis.originalEnv = { ...process.env }\n\t}\n\n\tprotected static async beforeEach() {\n\t\tawait super.beforeEach()\n\n\t\t//@ts-ignore\n\t\tprocess.env = { ...this.originalEnv }\n\n\t\ttestUtil.startLogTimer()\n\n\t\tSchemaRegistry.getInstance().forgetAllSchemas()\n\n\t\tthis.cwd = this.freshTmpDir()\n\t\tthis.homeDir = this.freshTmpDir()\n\n\t\tthis.emitter = undefined\n\t\tthis.featureInstaller = undefined\n\n\t\tOnboardingStore.overrideCwd(diskUtil.createRandomTempDir())\n\n\t\tthis.ui.reset()\n\t\tthis.ui.invocations = []\n\t\tthis.ui.setCursorPosition({ x: 0, y: 0 })\n\n\t\tthis.clearFixtures()\n\n\t\tImportService.clearCache()\n\t\tSkillStore.clearCurrentSkill()\n\t\tEventStore.clearCache()\n\t\tCommandService.clearMockResponses()\n\t}\n\n\tprotected static async afterEach() {\n\t\tawait super.afterEach()\n\n\t\tawait this.organizationFixture?.clearAllOrgs()\n\t\tawait this.mercuryFixture?.disconnectAll()\n\n\t\tthis.clearFixtures()\n\n\t\tif (this._ui?.isWaitingForInput()) {\n\t\t\tthrow new Error(\n\t\t\t\t`Terminal interface is waiting for input. Make sure you are invoking this.term.sendInput() as many times as needed.`\n\t\t\t)\n\t\t}\n\n\t\tif (diskUtil.doesDirExist(this.cwd) && testUtil.shouldClearCache()) {\n\t\t\tdiskUtil.deleteDir(this.cwd)\n\t\t}\n\n\t\tif (diskUtil.doesDirExist(this.homeDir) && testUtil.shouldClearCache()) {\n\t\t\tdiskUtil.deleteDir(this.homeDir)\n\t\t}\n\t}\n\n\tprotected static async afterAll() {\n\t\tawait super.afterAll()\n\t\tif (testUtil.shouldCleanupTestSkillDirs()) {\n\t\t\tFeatureFixture.deleteOldSkillDirs()\n\t\t}\n\t}\n\n\tprivate static async cleanTestDirsAndFiles() {\n\t\tconst pattern = this.resolveTestPath('**/*.d.ts')\n\t\tconst matches = await globby(pattern)\n\n\t\tfor (const match of matches) {\n\t\t\tdiskUtil.deleteFile(match)\n\t\t}\n\t}\n\n\tprivate static clearFixtures() {\n\t\tthis.emitter = undefined\n\t\tthis.mercuryFixture = undefined\n\t\tthis.organizationFixture = undefined\n\t\tthis.personFixture = undefined\n\t\tthis.skillFixture = undefined\n\t\tthis.viewFixture = undefined\n\t}\n\n\tprotected static freshTmpDir() {\n\t\tconst tmpDirectory = testUtil.resolveTestDir(uuid.v4())\n\t\tfs.ensureDirSync(tmpDirectory)\n\t\treturn tmpDirectory\n\t}\n\n\tprotected static get ui() {\n\t\tif (!this._ui) {\n\t\t\tthis._ui = new SpyInterface()\n\t\t}\n\n\t\treturn this._ui\n\t}\n\n\tprotected static getEmitter() {\n\t\tif (!this.emitter) {\n\t\t\tthis.emitter = CliGlobalEmitter.Emitter()\n\t\t}\n\t\treturn this.emitter\n\t}\n\n\tprotected static resolveTestPath(...pathAfterTestDirsAndFiles: string[]) {\n\t\treturn pathUtil.join(\n\t\t\tthis.cliRoot,\n\t\t\t'__tests__',\n\t\t\t'testDirsAndFiles',\n\t\t\t...pathAfterTestDirsAndFiles\n\t\t)\n\t}\n\n\tprotected static async Cli(options?: CliBootOptions) {\n\t\treturn this.FeatureFixture(options).Cli({\n\t\t\tcwd: this.cwd,\n\t\t\thomeDir: this.homeDir,\n\t\t\t...(options ?? {}),\n\t\t})\n\t}\n\n\tprotected static async linkLocalPackages() {\n\t\tconst fixture = this.FeatureFixture()\n\t\tawait fixture.linkLocalPackages()\n\t}\n\n\tprotected static Service<S extends Service>(\n\t\ttype: S,\n\t\tcwd?: string\n\t): ServiceMap[S] {\n\t\tconst sf = this.ServiceFactory()\n\t\treturn sf.Service(cwd ?? this.cwd, type)\n\t}\n\n\tprotected static ServiceFactory() {\n\t\treturn new ServiceFactory()\n\t}\n\n\tprotected static FeatureFixture(options?: Partial<FeatureFixtureOptions>) {\n\t\tconst emitter = options?.emitter ?? this.getEmitter()\n\n\t\treturn new FeatureFixture({\n\t\t\tcwd: this.cwd,\n\t\t\tserviceFactory: this.ServiceFactory(),\n\t\t\tui: this.ui,\n\t\t\temitter,\n\t\t\tapiClientFactory: this.getMercuryFixture().getApiClientFactory(),\n\t\t\tfeatureInstaller: this.getFeatureInstaller({ emitter }),\n\t\t\t...options,\n\t\t})\n\t}\n\n\tprotected static getMercuryFixture() {\n\t\tif (!this.mercuryFixture) {\n\t\t\tthis.mercuryFixture = new MercuryFixture(this.cwd, this.ServiceFactory())\n\t\t}\n\n\t\treturn this.mercuryFixture\n\t}\n\n\tprotected static getPersonFixture() {\n\t\tif (!this.personFixture) {\n\t\t\tthis.personFixture = new PersonFixture(\n\t\t\t\tthis.getMercuryFixture().getApiClientFactory()\n\t\t\t)\n\t\t}\n\n\t\treturn this.personFixture\n\t}\n\n\tprotected static getViewFixture() {\n\t\tif (!this.viewFixture) {\n\t\t\tconst writerFactory = this.WriterFactory()\n\n\t\t\tconst viewWriter = writerFactory.Writer('view', { fileDescriptions: [] })\n\t\t\tthis.viewFixture = new ViewFixture(\n\t\t\t\tthis.cwd,\n\t\t\t\tviewWriter,\n\t\t\t\tthis.Action('view', 'sync')\n\t\t\t)\n\t\t}\n\n\t\treturn this.viewFixture\n\t}\n\n\tprivate static WriterFactory() {\n\t\treturn new WriterFactory({\n\t\t\ttemplates,\n\t\t\tui: this.ui,\n\t\t\tsettings: this.Service('settings'),\n\t\t})\n\t}\n\n\tprotected static async skipInstallSkillPrompts<\n\t\tE extends () => Promise<FeatureActionResponse>\n\t>(\n\t\texecute?: E\n\t): Promise<E extends undefined ? undefined : FeatureActionResponse> {\n\t\tconst promise = execute?.()\n\n\t\tawait this.waitForInput()\n\t\tawait this.ui.sendInput('n')\n\n\t\tawait this.waitForInput()\n\t\tawait this.ui.sendInput('')\n\n\t\tconst results = await promise\n\n\t\treturn results as any\n\t}\n\n\tprotected static getOrganizationFixture() {\n\t\tif (!this.organizationFixture) {\n\t\t\tthis.organizationFixture = new OrganizationFixture(\n\t\t\t\tthis.getPersonFixture(),\n\t\t\t\tthis.StoreFactory()\n\t\t\t)\n\t\t}\n\n\t\treturn this.organizationFixture\n\t}\n\n\tprotected static getSkillFixture() {\n\t\tif (!this.skillFixture) {\n\t\t\tthis.skillFixture = new SkillFixture(\n\t\t\t\tthis.getPersonFixture(),\n\t\t\t\tthis.StoreFactory(),\n\t\t\t\tthis.getMercuryFixture().getApiClientFactory()\n\t\t\t)\n\t\t}\n\n\t\treturn this.skillFixture\n\t}\n\n\tprotected static resolveHashSprucePath(...filePath: string[]) {\n\t\treturn diskUtil.resolveHashSprucePath(this.cwd, ...filePath)\n\t}\n\n\tprotected static getFeatureInstaller(options?: Partial<FeatureOptions>) {\n\t\tif (!this.featureInstaller) {\n\t\t\tconst serviceFactory = this.ServiceFactory()\n\t\t\tconst storeFactory = this.StoreFactory(options)\n\t\t\tconst emitter = this.getEmitter()\n\t\t\tconst apiClientFactory = this.getMercuryFixture().getApiClientFactory()\n\n\t\t\tconst actionExecuter = this.ActionExecuter()\n\n\t\t\tthis.featureInstaller = FeatureInstallerFactory.WithAllFeatures({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\tserviceFactory,\n\t\t\t\tstoreFactory,\n\t\t\t\tui: this.ui,\n\t\t\t\temitter,\n\t\t\t\tapiClientFactory,\n\t\t\t\tactionExecuter,\n\t\t\t\t...options,\n\t\t\t})\n\t\t}\n\n\t\treturn this.featureInstaller\n\t}\n\n\tprotected static StoreFactory(options?: Partial<StoreFactoryOptions>) {\n\t\tconst serviceFactory = this.ServiceFactory()\n\n\t\treturn new StoreFactory({\n\t\t\tcwd: this.cwd,\n\t\t\tserviceFactory,\n\t\t\thomeDir: this.homeDir,\n\t\t\tapiClientFactory: this.getMercuryFixture().getApiClientFactory(),\n\t\t\temitter: this.getEmitter(),\n\t\t\t...options,\n\t\t})\n\t}\n\n\tprotected static Store<C extends StoreCode>(\n\t\tcode: C,\n\t\toptions?: StoreFactoryMethodOptions\n\t): StoreMap[C] {\n\t\treturn this.StoreFactory().Store(code, {\n\t\t\tcwd: this.cwd,\n\t\t\t...options,\n\t\t})\n\t}\n\n\tprotected static async waitForInput() {\n\t\treturn this.ui.waitForInput()\n\t}\n\n\tprotected static async assertIsFeatureInstalled(code: FeatureCode) {\n\t\tconst featureInstaller = this.getFeatureInstaller()\n\t\tconst isInstalled = await featureInstaller.isInstalled(code)\n\n\t\tassert.isTrue(isInstalled)\n\t}\n\n\tprotected static async assertValidActionResponseFiles(\n\t\tresults: FeatureActionResponse\n\t) {\n\t\tfor (const file of results.files ?? []) {\n\t\t\tconst checker = this.Service('typeChecker')\n\t\t\tawait checker.check(file.path)\n\t\t}\n\n\t\t// await Promise.all(\n\t\t// \t(results.files ?? []).map((file) => {\n\t\t// \t\tconst checker = this.Service('typeChecker')\n\t\t// \t\treturn checker.check(file.path)\n\t\t// \t})\n\t\t// )\n\t}\n\n\tprotected static async connectToApi(options?: ApiClientFactoryOptions) {\n\t\treturn this.getMercuryFixture().connectToApi(options)\n\t}\n\n\tprotected static async openInVsCode(options?: {\n\t\tfile?: string\n\t\tdir?: string\n\t\ttimeout?: number\n\t}) {\n\t\tawait this.Action('vscode', 'setup').execute({ all: true })\n\n\t\tawait this.Service('command').execute(\n\t\t\t`code ${options?.file ?? options?.dir ?? this.cwd}`\n\t\t)\n\t\tawait this.wait(options?.timeout ?? 99999999)\n\t}\n\n\tprotected static async openInFinder(options?: {\n\t\tfile?: string\n\t\tdir?: string\n\t\ttimeout?: number\n\t}) {\n\t\tawait this.Service('command').execute(\n\t\t\t`open ${options?.file ?? options?.dir ?? this.cwd}`\n\t\t)\n\t\tawait this.wait(options?.timeout ?? 99999999)\n\t}\n\n\tprotected static log(...args: any[]) {\n\t\ttestUtil.log(...args)\n\t}\n\n\tprotected static Action<\n\t\tAction extends AbstractAction = AbstractAction,\n\t\tF extends FeatureCode = FeatureCode\n\t>(featureCode: F, actionCode: string, options?: ExecuterOptions): Action {\n\t\tconst executer = this.ActionExecuter({\n\t\t\tshouldThrowOnListenerError: true,\n\t\t\t...options,\n\t\t}).Action(featureCode, actionCode)\n\n\t\treturn executer as any\n\t}\n\n\tprotected static ActionExecuter(options?: ExecuterOptions) {\n\t\tconst serviceFactory = this.ServiceFactory()\n\t\tconst writerFactory = this.WriterFactory()\n\n\t\tconst emitter = this.getEmitter()\n\n\t\tconst actionFactory = new ActionFactory({\n\t\t\twriterFactory,\n\t\t\tui: this.ui,\n\t\t\temitter,\n\t\t\tapiClientFactory: this.getMercuryFixture().getApiClientFactory(),\n\t\t\tcwd: this.cwd,\n\t\t\tserviceFactory,\n\t\t\tstoreFactory: this.StoreFactory(),\n\t\t\ttemplates,\n\t\t\toptionOverrides: {\n\t\t\t\t'sync.schemas': {\n\t\t\t\t\tshouldInstallMissingDependencies: true,\n\t\t\t\t},\n\t\t\t\t...options?.optionOverrides,\n\t\t\t},\n\t\t})\n\n\t\tconst executer = new ActionExecuter({\n\t\t\tui: this.ui,\n\t\t\temitter,\n\t\t\tactionFactory,\n\t\t\tfeatureInstallerFactory: () => {\n\t\t\t\treturn this.getFeatureInstaller()\n\t\t\t},\n\t\t\tshouldAutoHandleDependencies: false,\n\t\t\t...options,\n\t\t})\n\n\t\treturn executer\n\t}\n\n\tprotected static selectOptionBasedOnLabel(label: string) {\n\t\tconst last = this.ui.getLastInvocation()\n\t\tassert.doesInclude(last.options.options.choices, {\n\t\t\tlabel,\n\t\t})\n\n\t\tconst match = last.options.options.choices.find(\n\t\t\t(o: any) => o.label === label\n\t\t)\n\n\t\tvoid this.ui.sendInput(`${match.value}`)\n\t}\n}\n"],"file":"AbstractCliTest.js"}
1
+ {"version":3,"sources":["../../src/tests/AbstractCliTest.ts"],"names":["AbstractCliTest","cleanTestDirsAndFiles","LintService","disableLinting","ImportService","setCacheDir","diskUtil","createRandomTempDir","enableCaching","process","env","ENABLE_INSTALL_INTERTAINMENT","originalEnv","testUtil","startLogTimer","SchemaRegistry","getInstance","forgetAllSchemas","cwd","freshTmpDir","homeDir","emitter","undefined","featureInstaller","OnboardingStore","overrideCwd","ui","reset","invocations","setCursorPosition","x","y","clearFixtures","clearCache","SkillStore","clearCurrentSkill","EventStore","CommandService","clearMockResponses","MercuryClientFactory","organizationFixture","clearAllOrgs","mercuryFixture","disconnectAll","_ui","isWaitingForInput","Error","doesDirExist","shouldClearCache","deleteDir","shouldCleanupTestSkillDirs","FeatureFixture","deleteOldSkillDirs","pattern","resolveTestPath","matches","match","deleteFile","personFixture","skillFixture","viewFixture","tmpDirectory","resolveTestDir","uuid","v4","fs","ensureDirSync","SpyInterface","CliGlobalEmitter","Emitter","pathAfterTestDirsAndFiles","pathUtil","join","cliRoot","options","Cli","fixture","linkLocalPackages","type","sf","ServiceFactory","Service","getEmitter","serviceFactory","apiClientFactory","getMercuryFixture","getApiClientFactory","getFeatureInstaller","MercuryFixture","PersonFixture","writerFactory","WriterFactory","viewWriter","Writer","fileDescriptions","ViewFixture","Action","templates","settings","execute","promise","waitForInput","sendInput","results","OrganizationFixture","people","StoreFactory","SkillFixture","filePath","resolveHashSprucePath","storeFactory","actionExecuter","ActionExecuter","FeatureInstallerFactory","WithAllFeatures","code","Store","isInstalled","assert","isTrue","files","file","checker","check","path","connectToApi","all","dir","wait","timeout","log","featureCode","actionCode","executer","shouldThrowOnListenerError","actionFactory","ActionFactory","optionOverrides","shouldInstallMissingDependencies","featureInstallerFactory","shouldAutoHandleDependencies","label","last","getLastInvocation","doesInclude","choices","find","o","value","AbstractSpruceTest","__dirname"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AAGA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;IAM8BA,e;;;;;;;;;;;;;qGAc7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,uBAEO,KAAKC,qBAAL,EAFP;;AAAA;AAICC,wCAAYC,cAAZ;;AAEAC,0CAAcC,WAAd,CAA0BC,2BAASC,mBAAT,EAA1B;;AACAH,0CAAcI,aAAd;;AAEAC,gBAAAA,OAAO,CAACC,GAAR,CAAYC,4BAAZ,GAA2C,OAA3C;AAEA,qBAAKC,WAAL,qBAAwBH,OAAO,CAACC,GAAhC;;AAXD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;sGAcA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAGC;AACAD,gBAAAA,OAAO,CAACC,GAAR,qBAAmB,KAAKE,WAAxB;;AAEAC,kCAASC,aAAT;;AAEAC,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AF,KAAYA,KAAxB;AAAA,OADa,CAAd;AAIA,WAAK,KAAKnH,EAAL,CAAQ4E,SAAR,WAAqB9C,KAAK,CAAC4F,KAA3B,EAAL;AACA;;;EA5aoDC,gB;;;iCAAxBrJ,e,aACFuE,iBAASC,IAAT,CAAc8E,SAAd,EAAyB,IAAzB,C;iCADEtJ,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e;iCAAAA,e","sourcesContent":["import pathUtil from 'path'\nimport { MercuryClientFactory } from '@sprucelabs/mercury-client'\nimport { SchemaRegistry } from '@sprucelabs/schema'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { templates } from '@sprucelabs/spruce-templates'\nimport AbstractSpruceTest, { assert } from '@sprucelabs/test'\nimport fs from 'fs-extra'\nimport globby from 'globby'\nimport * as uuid from 'uuid'\nimport { CliBootOptions } from '../cli'\nimport AbstractAction from '../features/AbstractAction'\nimport { FeatureOptions } from '../features/AbstractFeature'\nimport ActionExecuter, {\n\tActionExecuterOptions,\n} from '../features/ActionExecuter'\nimport ActionFactory from '../features/ActionFactory'\nimport EventStore from '../features/event/stores/EventStore'\nimport FeatureInstaller from '../features/FeatureInstaller'\nimport FeatureInstallerFactory from '../features/FeatureInstallerFactory'\nimport { FeatureActionResponse, FeatureCode } from '../features/features.types'\nimport OnboardingStore from '../features/onboard/stores/OnboardingStore'\nimport SkillStore from '../features/skill/stores/SkillStore'\nimport CliGlobalEmitter, { GlobalEmitter } from '../GlobalEmitter'\nimport SpyInterface from '../interfaces/SpyInterface'\nimport CommandService from '../services/CommandService'\nimport ImportService from '../services/ImportService'\nimport LintService from '../services/LintService'\nimport ServiceFactory, { Service, ServiceMap } from '../services/ServiceFactory'\nimport StoreFactory, {\n\tStoreCode,\n\tStoreFactoryMethodOptions,\n\tStoreFactoryOptions,\n\tStoreMap,\n} from '../stores/StoreFactory'\nimport { ApiClientFactoryOptions } from '../types/apiClient.types'\nimport { OptionOverrides } from '../types/cli.types'\nimport WriterFactory from '../writers/WriterFactory'\nimport FeatureFixture, {\n\tFeatureFixtureOptions,\n} from './fixtures/FeatureFixture'\nimport MercuryFixture from './fixtures/MercuryFixture'\nimport OrganizationFixture from './fixtures/OrganizationFixture'\nimport PersonFixture from './fixtures/PersonFixture'\nimport SkillFixture from './fixtures/SkillFixture'\nimport ViewFixture from './fixtures/ViewFixture'\nimport testUtil from './utilities/test.utility'\n\ntype ExecuterOptions = Partial<ActionExecuterOptions> & {\n\toptionOverrides?: OptionOverrides\n}\n\nexport default abstract class AbstractCliTest extends AbstractSpruceTest {\n\tprotected static cliRoot = pathUtil.join(__dirname, '..')\n\tprotected static homeDir: string\n\n\tprivate static _ui: SpyInterface\n\tprivate static emitter?: GlobalEmitter\n\tprivate static mercuryFixture?: MercuryFixture\n\tprivate static personFixture?: PersonFixture\n\tprivate static organizationFixture?: OrganizationFixture\n\tprivate static skillFixture?: SkillFixture\n\tprivate static featureInstaller?: FeatureInstaller\n\tprivate static viewFixture?: ViewFixture\n\tprivate static originalEnv: { [x: string]: string | undefined }\n\n\tprotected static async beforeAll() {\n\t\tawait super.beforeAll()\n\t\tawait this.cleanTestDirsAndFiles()\n\n\t\tLintService.disableLinting()\n\n\t\tImportService.setCacheDir(diskUtil.createRandomTempDir())\n\t\tImportService.enableCaching()\n\n\t\tprocess.env.ENABLE_INSTALL_INTERTAINMENT = 'false'\n\n\t\tthis.originalEnv = { ...process.env }\n\t}\n\n\tprotected static async beforeEach() {\n\t\tawait super.beforeEach()\n\n\t\t//@ts-ignore\n\t\tprocess.env = { ...this.originalEnv }\n\n\t\ttestUtil.startLogTimer()\n\n\t\tSchemaRegistry.getInstance().forgetAllSchemas()\n\n\t\tthis.cwd = this.freshTmpDir()\n\t\tthis.homeDir = this.freshTmpDir()\n\n\t\tthis.emitter = undefined\n\t\tthis.featureInstaller = undefined\n\n\t\tOnboardingStore.overrideCwd(diskUtil.createRandomTempDir())\n\n\t\tthis.ui.reset()\n\t\tthis.ui.invocations = []\n\t\tthis.ui.setCursorPosition({ x: 0, y: 0 })\n\n\t\tthis.clearFixtures()\n\n\t\tImportService.clearCache()\n\t\tSkillStore.clearCurrentSkill()\n\t\tEventStore.clearCache()\n\t\tCommandService.clearMockResponses()\n\t\tMercuryClientFactory.reset()\n\t}\n\n\tprotected static async afterEach() {\n\t\tawait super.afterEach()\n\n\t\tawait this.organizationFixture?.clearAllOrgs()\n\t\tawait this.mercuryFixture?.disconnectAll()\n\n\t\tthis.clearFixtures()\n\n\t\tif (this._ui?.isWaitingForInput()) {\n\t\t\tthrow new Error(\n\t\t\t\t`Terminal interface is waiting for input. Make sure you are invoking this.term.sendInput() as many times as needed.`\n\t\t\t)\n\t\t}\n\n\t\tif (diskUtil.doesDirExist(this.cwd) && testUtil.shouldClearCache()) {\n\t\t\tdiskUtil.deleteDir(this.cwd)\n\t\t}\n\n\t\tif (diskUtil.doesDirExist(this.homeDir) && testUtil.shouldClearCache()) {\n\t\t\tdiskUtil.deleteDir(this.homeDir)\n\t\t}\n\t}\n\n\tprotected static async afterAll() {\n\t\tawait super.afterAll()\n\t\tif (testUtil.shouldCleanupTestSkillDirs()) {\n\t\t\tFeatureFixture.deleteOldSkillDirs()\n\t\t}\n\t}\n\n\tprivate static async cleanTestDirsAndFiles() {\n\t\tconst pattern = this.resolveTestPath('**/*.d.ts')\n\t\tconst matches = await globby(pattern)\n\n\t\tfor (const match of matches) {\n\t\t\tdiskUtil.deleteFile(match)\n\t\t}\n\t}\n\n\tprivate static clearFixtures() {\n\t\tthis.emitter = undefined\n\t\tthis.mercuryFixture = undefined\n\t\tthis.organizationFixture = undefined\n\t\tthis.personFixture = undefined\n\t\tthis.skillFixture = undefined\n\t\tthis.viewFixture = undefined\n\t}\n\n\tprotected static freshTmpDir() {\n\t\tconst tmpDirectory = testUtil.resolveTestDir(uuid.v4())\n\t\tfs.ensureDirSync(tmpDirectory)\n\t\treturn tmpDirectory\n\t}\n\n\tprotected static get ui() {\n\t\tif (!this._ui) {\n\t\t\tthis._ui = new SpyInterface()\n\t\t}\n\n\t\treturn this._ui\n\t}\n\n\tprotected static getEmitter() {\n\t\tif (!this.emitter) {\n\t\t\tthis.emitter = CliGlobalEmitter.Emitter()\n\t\t}\n\t\treturn this.emitter\n\t}\n\n\tprotected static resolveTestPath(...pathAfterTestDirsAndFiles: string[]) {\n\t\treturn pathUtil.join(\n\t\t\tthis.cliRoot,\n\t\t\t'__tests__',\n\t\t\t'testDirsAndFiles',\n\t\t\t...pathAfterTestDirsAndFiles\n\t\t)\n\t}\n\n\tprotected static async Cli(options?: CliBootOptions) {\n\t\treturn this.FeatureFixture(options).Cli({\n\t\t\tcwd: this.cwd,\n\t\t\thomeDir: this.homeDir,\n\t\t\t...(options ?? {}),\n\t\t})\n\t}\n\n\tprotected static async linkLocalPackages() {\n\t\tconst fixture = this.FeatureFixture()\n\t\tawait fixture.linkLocalPackages()\n\t}\n\n\tprotected static Service<S extends Service>(\n\t\ttype: S,\n\t\tcwd?: string\n\t): ServiceMap[S] {\n\t\tconst sf = this.ServiceFactory()\n\t\treturn sf.Service(cwd ?? this.cwd, type)\n\t}\n\n\tprotected static ServiceFactory() {\n\t\treturn new ServiceFactory()\n\t}\n\n\tprotected static FeatureFixture(options?: Partial<FeatureFixtureOptions>) {\n\t\tconst emitter = options?.emitter ?? this.getEmitter()\n\n\t\treturn new FeatureFixture({\n\t\t\tcwd: this.cwd,\n\t\t\tserviceFactory: this.ServiceFactory(),\n\t\t\tui: this.ui,\n\t\t\temitter,\n\t\t\tapiClientFactory: this.getMercuryFixture().getApiClientFactory(),\n\t\t\tfeatureInstaller: this.getFeatureInstaller({ emitter }),\n\t\t\t...options,\n\t\t})\n\t}\n\n\tprotected static getMercuryFixture() {\n\t\tif (!this.mercuryFixture) {\n\t\t\tthis.mercuryFixture = new MercuryFixture(this.cwd, this.ServiceFactory())\n\t\t}\n\n\t\treturn this.mercuryFixture\n\t}\n\n\tprotected static get people() {\n\t\tif (!this.personFixture) {\n\t\t\tthis.personFixture = new PersonFixture(\n\t\t\t\tthis.getMercuryFixture().getApiClientFactory()\n\t\t\t)\n\t\t}\n\n\t\treturn this.personFixture\n\t}\n\n\tprotected static getViewFixture() {\n\t\tif (!this.viewFixture) {\n\t\t\tconst writerFactory = this.WriterFactory()\n\n\t\t\tconst viewWriter = writerFactory.Writer('view', { fileDescriptions: [] })\n\t\t\tthis.viewFixture = new ViewFixture(\n\t\t\t\tthis.cwd,\n\t\t\t\tviewWriter,\n\t\t\t\tthis.Action('view', 'sync')\n\t\t\t)\n\t\t}\n\n\t\treturn this.viewFixture\n\t}\n\n\tprivate static WriterFactory() {\n\t\treturn new WriterFactory({\n\t\t\ttemplates,\n\t\t\tui: this.ui,\n\t\t\tsettings: this.Service('settings'),\n\t\t})\n\t}\n\n\tprotected static async skipInstallSkillPrompts<\n\t\tE extends () => Promise<FeatureActionResponse>\n\t>(\n\t\texecute?: E\n\t): Promise<E extends undefined ? undefined : FeatureActionResponse> {\n\t\tconst promise = execute?.()\n\n\t\tawait this.waitForInput()\n\t\tawait this.ui.sendInput('n')\n\n\t\tawait this.waitForInput()\n\t\tawait this.ui.sendInput('')\n\n\t\tconst results = await promise\n\n\t\treturn results as any\n\t}\n\n\tprotected static getOrganizationFixture() {\n\t\tif (!this.organizationFixture) {\n\t\t\tthis.organizationFixture = new OrganizationFixture(\n\t\t\t\tthis.people,\n\t\t\t\tthis.StoreFactory()\n\t\t\t)\n\t\t}\n\n\t\treturn this.organizationFixture\n\t}\n\n\tprotected static getSkillFixture() {\n\t\tif (!this.skillFixture) {\n\t\t\tthis.skillFixture = new SkillFixture(\n\t\t\t\tthis.people,\n\t\t\t\tthis.StoreFactory(),\n\t\t\t\tthis.getMercuryFixture().getApiClientFactory()\n\t\t\t)\n\t\t}\n\n\t\treturn this.skillFixture\n\t}\n\n\tprotected static resolveHashSprucePath(...filePath: string[]) {\n\t\treturn diskUtil.resolveHashSprucePath(this.cwd, ...filePath)\n\t}\n\n\tprotected static getFeatureInstaller(options?: Partial<FeatureOptions>) {\n\t\tif (!this.featureInstaller) {\n\t\t\tconst serviceFactory = this.ServiceFactory()\n\t\t\tconst storeFactory = this.StoreFactory(options)\n\t\t\tconst emitter = this.getEmitter()\n\t\t\tconst apiClientFactory = this.getMercuryFixture().getApiClientFactory()\n\n\t\t\tconst actionExecuter = this.ActionExecuter()\n\n\t\t\tthis.featureInstaller = FeatureInstallerFactory.WithAllFeatures({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\tserviceFactory,\n\t\t\t\tstoreFactory,\n\t\t\t\tui: this.ui,\n\t\t\t\temitter,\n\t\t\t\tapiClientFactory,\n\t\t\t\tactionExecuter,\n\t\t\t\t...options,\n\t\t\t})\n\t\t}\n\n\t\treturn this.featureInstaller\n\t}\n\n\tprotected static StoreFactory(options?: Partial<StoreFactoryOptions>) {\n\t\tconst serviceFactory = this.ServiceFactory()\n\n\t\treturn new StoreFactory({\n\t\t\tcwd: this.cwd,\n\t\t\tserviceFactory,\n\t\t\thomeDir: this.homeDir,\n\t\t\tapiClientFactory: this.getMercuryFixture().getApiClientFactory(),\n\t\t\temitter: this.getEmitter(),\n\t\t\t...options,\n\t\t})\n\t}\n\n\tprotected static Store<C extends StoreCode>(\n\t\tcode: C,\n\t\toptions?: StoreFactoryMethodOptions\n\t): StoreMap[C] {\n\t\treturn this.StoreFactory().Store(code, {\n\t\t\tcwd: this.cwd,\n\t\t\t...options,\n\t\t})\n\t}\n\n\tprotected static async waitForInput() {\n\t\treturn this.ui.waitForInput()\n\t}\n\n\tprotected static async assertIsFeatureInstalled(code: FeatureCode) {\n\t\tconst featureInstaller = this.getFeatureInstaller()\n\t\tconst isInstalled = await featureInstaller.isInstalled(code)\n\n\t\tassert.isTrue(isInstalled)\n\t}\n\n\tprotected static async assertValidActionResponseFiles(\n\t\tresults: FeatureActionResponse\n\t) {\n\t\tfor (const file of results.files ?? []) {\n\t\t\tconst checker = this.Service('typeChecker')\n\t\t\tawait checker.check(file.path)\n\t\t}\n\n\t\t// await Promise.all(\n\t\t// \t(results.files ?? []).map((file) => {\n\t\t// \t\tconst checker = this.Service('typeChecker')\n\t\t// \t\treturn checker.check(file.path)\n\t\t// \t})\n\t\t// )\n\t}\n\n\tprotected static async connectToApi(options?: ApiClientFactoryOptions) {\n\t\treturn this.getMercuryFixture().connectToApi(options)\n\t}\n\n\tprotected static async openInVsCode(options?: {\n\t\tfile?: string\n\t\tdir?: string\n\t\ttimeout?: number\n\t}) {\n\t\tawait this.Action('vscode', 'setup').execute({ all: true })\n\n\t\tawait this.Service('command').execute(\n\t\t\t`code ${options?.file ?? options?.dir ?? this.cwd}`\n\t\t)\n\t\tawait this.wait(options?.timeout ?? 99999999)\n\t}\n\n\tprotected static async openInFinder(options?: {\n\t\tfile?: string\n\t\tdir?: string\n\t\ttimeout?: number\n\t}) {\n\t\tawait this.Service('command').execute(\n\t\t\t`open ${options?.file ?? options?.dir ?? this.cwd}`\n\t\t)\n\t\tawait this.wait(options?.timeout ?? 99999999)\n\t}\n\n\tprotected static log(...args: any[]) {\n\t\ttestUtil.log(...args)\n\t}\n\n\tprotected static Action<\n\t\tAction extends AbstractAction = AbstractAction,\n\t\tF extends FeatureCode = FeatureCode\n\t>(featureCode: F, actionCode: string, options?: ExecuterOptions): Action {\n\t\tconst executer = this.ActionExecuter({\n\t\t\tshouldThrowOnListenerError: true,\n\t\t\t...options,\n\t\t}).Action(featureCode, actionCode)\n\n\t\treturn executer as any\n\t}\n\n\tprotected static ActionExecuter(options?: ExecuterOptions) {\n\t\tconst serviceFactory = this.ServiceFactory()\n\t\tconst writerFactory = this.WriterFactory()\n\n\t\tconst emitter = this.getEmitter()\n\n\t\tconst actionFactory = new ActionFactory({\n\t\t\twriterFactory,\n\t\t\tui: this.ui,\n\t\t\temitter,\n\t\t\tapiClientFactory: this.getMercuryFixture().getApiClientFactory(),\n\t\t\tcwd: this.cwd,\n\t\t\tserviceFactory,\n\t\t\tstoreFactory: this.StoreFactory(),\n\t\t\ttemplates,\n\t\t\toptionOverrides: {\n\t\t\t\t'sync.schemas': {\n\t\t\t\t\tshouldInstallMissingDependencies: true,\n\t\t\t\t},\n\t\t\t\t...options?.optionOverrides,\n\t\t\t},\n\t\t})\n\n\t\tconst executer = new ActionExecuter({\n\t\t\tui: this.ui,\n\t\t\temitter,\n\t\t\tactionFactory,\n\t\t\tfeatureInstallerFactory: () => {\n\t\t\t\treturn this.getFeatureInstaller()\n\t\t\t},\n\t\t\tshouldAutoHandleDependencies: false,\n\t\t\t...options,\n\t\t})\n\n\t\treturn executer\n\t}\n\n\tprotected static selectOptionBasedOnLabel(label: string) {\n\t\tconst last = this.ui.getLastInvocation()\n\t\tassert.doesInclude(last.options.options.choices, {\n\t\t\tlabel,\n\t\t})\n\n\t\tconst match = last.options.options.choices.find(\n\t\t\t(o: any) => o.label === label\n\t\t)\n\n\t\tvoid this.ui.sendInput(`${match.value}`)\n\t}\n}\n"],"file":"AbstractCliTest.js"}
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  ]
19
19
  },
20
20
  "license": "MIT",
21
- "version": "14.30.9",
21
+ "version": "14.30.13",
22
22
  "bin": {
23
23
  "spruce": "./build/index.js"
24
24
  },
@@ -76,21 +76,21 @@
76
76
  "@babel/plugin-proposal-decorators": "^7.16.7",
77
77
  "@babel/runtime": "^7.16.7",
78
78
  "@jest/reporters": "^27.4.6",
79
- "@sprucelabs/error": "^5.0.381",
80
- "@sprucelabs/heartwood-view-controllers": "^57.2.1",
81
- "@sprucelabs/jest-json-reporter": "^6.0.312",
82
- "@sprucelabs/mercury-client": "^20.0.16",
83
- "@sprucelabs/mercury-event-emitter": "^20.0.16",
84
- "@sprucelabs/mercury-types": "^26.2.90",
85
- "@sprucelabs/schema": "^25.6.88",
86
- "@sprucelabs/spruce-core-schemas": "^22.8.56",
87
- "@sprucelabs/spruce-event-plugin": "^23.0.13",
88
- "@sprucelabs/spruce-event-utils": "^17.1.560",
89
- "@sprucelabs/spruce-skill-booter": "^23.0.13",
90
- "@sprucelabs/spruce-skill-utils": "^23.0.16",
91
- "@sprucelabs/spruce-templates": "^14.30.9",
92
- "@typescript-eslint/eslint-plugin": "^5.10.0",
93
- "@typescript-eslint/parser": "^5.10.0",
79
+ "@sprucelabs/error": "^5.0.383",
80
+ "@sprucelabs/heartwood-view-controllers": "^57.7.0",
81
+ "@sprucelabs/jest-json-reporter": "^6.0.314",
82
+ "@sprucelabs/mercury-client": "^20.0.35",
83
+ "@sprucelabs/mercury-event-emitter": "^20.0.35",
84
+ "@sprucelabs/mercury-types": "^26.2.114",
85
+ "@sprucelabs/schema": "^25.6.112",
86
+ "@sprucelabs/spruce-core-schemas": "^22.8.81",
87
+ "@sprucelabs/spruce-event-plugin": "^23.0.34",
88
+ "@sprucelabs/spruce-event-utils": "^17.1.583",
89
+ "@sprucelabs/spruce-skill-booter": "^23.0.34",
90
+ "@sprucelabs/spruce-skill-utils": "^23.0.41",
91
+ "@sprucelabs/spruce-templates": "^14.30.13",
92
+ "@typescript-eslint/eslint-plugin": "^5.10.1",
93
+ "@typescript-eslint/parser": "^5.10.1",
94
94
  "cfonts": "^2.10.0",
95
95
  "chalk": "^4.1.2",
96
96
  "chokidar": "^3.5.3",
@@ -119,18 +119,18 @@
119
119
  "uuid": "^8.3.2"
120
120
  },
121
121
  "devDependencies": {
122
- "@sprucelabs/data-stores": "^7.2.227",
123
- "@sprucelabs/jest-sheets-reporter": "^1.2.313",
124
- "@sprucelabs/mercury-core-events": "^1.7.146",
122
+ "@sprucelabs/data-stores": "^7.2.252",
123
+ "@sprucelabs/jest-sheets-reporter": "^1.2.317",
124
+ "@sprucelabs/mercury-core-events": "^1.7.168",
125
125
  "@sprucelabs/resolve-path-aliases": "^1.0.255",
126
- "@sprucelabs/spruce-conversation-plugin": "^23.0.13",
127
- "@sprucelabs/spruce-deploy-plugin": "^23.0.13",
128
- "@sprucelabs/spruce-store-plugin": "^23.0.13",
129
- "@sprucelabs/spruce-test-fixtures": "^23.0.13",
126
+ "@sprucelabs/spruce-conversation-plugin": "^23.0.34",
127
+ "@sprucelabs/spruce-deploy-plugin": "^23.0.34",
128
+ "@sprucelabs/spruce-store-plugin": "^23.0.34",
129
+ "@sprucelabs/spruce-test-fixtures": "^23.0.34",
130
130
  "@sprucelabs/test": "^7.7.276",
131
- "@sprucelabs/test-utils": "^3.0.385",
131
+ "@sprucelabs/test-utils": "^3.0.389",
132
132
  "@types/blessed": "^0.1.19",
133
- "@types/eslint": "^8.4.0",
133
+ "@types/eslint": "^8.4.1",
134
134
  "@types/fs-extra": "^9.0.13",
135
135
  "@types/inflection": "^1.13.0",
136
136
  "@types/inquirer": "^8.1.3",
@@ -138,20 +138,20 @@
138
138
  "@types/lodash": "^4.14.178",
139
139
  "@types/md5": "^2.3.1",
140
140
  "@types/mkdirp": "^1.0.2",
141
- "@types/node": "^17.0.10",
141
+ "@types/node": "^17.0.12",
142
142
  "@types/promise.allsettled": "^1.0.3",
143
143
  "@types/ps-node": "^0.1.1",
144
144
  "@types/rimraf": "^3.0.2",
145
145
  "@types/semver": "^7.3.9",
146
146
  "@types/sha1": "^1.1.3",
147
147
  "@types/slug": "^5.0.3",
148
- "@types/superagent": "^4.1.14",
148
+ "@types/superagent": "^4.1.15",
149
149
  "@types/terminal-kit": "^1.28.4",
150
150
  "@types/uuid": "^8.3.4",
151
151
  "chokidar-cli": "^3.0.0",
152
152
  "concurrently": "^7.0.0",
153
153
  "conventional-changelog-sprucelabs": "^1.1.2",
154
- "dotenv": "^14.2.0",
154
+ "dotenv": "^14.3.2",
155
155
  "eslint": "^8.7.0",
156
156
  "eslint-config-spruce": "^10.11.2",
157
157
  "find-process": "^1.4.7",
@@ -597,5 +597,5 @@
597
597
  "ora"
598
598
  ]
599
599
  },
600
- "gitHead": "a8e5ddeb65b564d007b11424fbec958d24671877"
600
+ "gitHead": "68a49ba5ab59ac0b586d4db3868f45598e136fd7"
601
601
  }
@@ -101,7 +101,7 @@ export default class ConfiguringDependenciesTest extends AbstractSkillTest {
101
101
 
102
102
  @test()
103
103
  protected static async doesNotShowSkillsThatAreAlreadySetAsADependency() {
104
- await this.getPersonFixture().loginAsDemoPerson()
104
+ await this.people.loginAsDemoPerson()
105
105
 
106
106
  void this.Action('dependency', 'add').execute({})
107
107
 
@@ -122,9 +122,7 @@ export default class ConfiguringDependenciesTest extends AbstractSkillTest {
122
122
  name: 'global dependency skill',
123
123
  })
124
124
 
125
- await this.getPersonFixture().loginAsDemoPerson(
126
- process.env.DEMO_NUMBER_GLOBAL_EVENTS
127
- )
125
+ await this.people.loginAsDemoPerson(process.env.DEMO_NUMBER_GLOBAL_EVENTS)
128
126
 
129
127
  const results = await this.Action('dependency', 'add').execute({
130
128
  namespace: skill.slug,
@@ -21,7 +21,7 @@ export default class DeployingToSandboxTest extends AbstractCliTest {
21
21
  protected static async beforeEach() {
22
22
  await super.beforeEach()
23
23
 
24
- const personFixture = this.getPersonFixture()
24
+ const personFixture = this.people
25
25
  await personFixture.loginAsDemoPerson(this.sandboxDemoNumber)
26
26
  }
27
27