@sprucelabs/spruce-cli 28.1.4 → 28.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/build/.spruce/errors/errors.types.d.ts +22 -0
  3. package/build/.spruce/errors/options.types.d.ts +4 -1
  4. package/build/.spruce/errors/spruceCli/agentAlreadyRegistered.schema.d.ts +3 -0
  5. package/build/.spruce/errors/spruceCli/agentAlreadyRegistered.schema.js +21 -0
  6. package/build/.spruce/errors/spruceCli/agentAlreadyRegistered.schema.js.map +1 -0
  7. package/build/__tests__/behavioral/agents/RegisteringAnAgentAtBoot.test.d.ts +15 -0
  8. package/build/__tests__/behavioral/agents/RegisteringAnAgentAtBoot.test.js +94 -0
  9. package/build/__tests__/behavioral/agents/RegisteringAnAgentAtBoot.test.js.map +1 -0
  10. package/build/__tests__/behavioral/onboard/StartingOnboarding.test.js +0 -7
  11. package/build/__tests__/behavioral/onboard/StartingOnboarding.test.js.map +1 -1
  12. package/build/__tests__/behavioral/permissions/SyncingPermissions.test.d.ts +7 -0
  13. package/build/__tests__/behavioral/permissions/SyncingPermissions.test.js +116 -14
  14. package/build/__tests__/behavioral/permissions/SyncingPermissions.test.js.map +1 -1
  15. package/build/__tests__/behavioral/{SettingRemote.test.d.ts → remote/SettingRemote.test.d.ts} +2 -2
  16. package/build/__tests__/behavioral/{SettingRemote.test.js → remote/SettingRemote.test.js} +2 -2
  17. package/build/__tests__/behavioral/remote/SettingRemote.test.js.map +1 -0
  18. package/build/__tests__/behavioral/remote/SettingRemoteDoesNotAskTwice.test.d.ts +10 -0
  19. package/build/__tests__/behavioral/remote/SettingRemoteDoesNotAskTwice.test.js +67 -0
  20. package/build/__tests__/behavioral/remote/SettingRemoteDoesNotAskTwice.test.js.map +1 -0
  21. package/build/__tests__/behavioral/tests/CreatingATest.test.js +1 -1
  22. package/build/__tests__/behavioral/tests/CreatingATest.test.js.map +1 -1
  23. package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js +1 -1
  24. package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js.map +1 -1
  25. package/build/__tests__/behavioral/tests/TestingDataStores.test.js +3 -3
  26. package/build/__tests__/behavioral/tests/TestingDataStores.test.js.map +1 -1
  27. package/build/__tests__/support/EventFaker.d.ts +2 -0
  28. package/build/__tests__/support/EventFaker.js +7 -0
  29. package/build/__tests__/support/EventFaker.js.map +1 -1
  30. package/build/errors/SpruceError.js +3 -0
  31. package/build/errors/SpruceError.js.map +1 -1
  32. package/build/errors/agentAlreadyRegistered.builder.d.ts +13 -0
  33. package/build/errors/agentAlreadyRegistered.builder.js +16 -0
  34. package/build/errors/agentAlreadyRegistered.builder.js.map +1 -0
  35. package/build/features/ActionExecuter.js.map +1 -1
  36. package/build/features/FeatureInstaller.d.ts +1 -1
  37. package/build/features/FeatureInstallerFactory.js +3 -0
  38. package/build/features/FeatureInstallerFactory.js.map +1 -1
  39. package/build/features/agent/AgentFeature.d.ts +22 -0
  40. package/build/features/agent/AgentFeature.js +24 -0
  41. package/build/features/agent/AgentFeature.js.map +1 -0
  42. package/build/features/agent/actions/RegisterAction.d.ts +54 -0
  43. package/build/features/agent/actions/RegisterAction.js +76 -0
  44. package/build/features/agent/actions/RegisterAction.js.map +1 -0
  45. package/build/features/agent/stores/AgentStore.d.ts +5 -0
  46. package/build/features/agent/stores/AgentStore.js +18 -0
  47. package/build/features/agent/stores/AgentStore.js.map +1 -0
  48. package/build/features/agent/writers/AgentWriter.d.ts +8 -0
  49. package/build/features/agent/writers/AgentWriter.js +31 -0
  50. package/build/features/agent/writers/AgentWriter.js.map +1 -0
  51. package/build/features/event/EventFeature.js +1 -0
  52. package/build/features/event/EventFeature.js.map +1 -1
  53. package/build/features/permission/writers/PermissionWriter.js +10 -1
  54. package/build/features/permission/writers/PermissionWriter.js.map +1 -1
  55. package/build/stores/StoreFactory.d.ts +2 -0
  56. package/build/stores/StoreFactory.js +2 -0
  57. package/build/stores/StoreFactory.js.map +1 -1
  58. package/build/tests/buildTestCache.js +7 -1
  59. package/build/tests/buildTestCache.js.map +1 -1
  60. package/build/tests/utilities/test.utility.js +3 -3
  61. package/build/writers/WriterFactory.d.ts +2 -0
  62. package/build/writers/WriterFactory.js +2 -0
  63. package/build/writers/WriterFactory.js.map +1 -1
  64. package/package.json +24 -24
  65. package/src/.spruce/errors/errors.types.ts +40 -9
  66. package/src/.spruce/errors/options.types.ts +4 -1
  67. package/src/.spruce/errors/spruceCli/agentAlreadyRegistered.schema.ts +24 -0
  68. package/src/__tests__/behavioral/agents/RegisteringAnAgentAtBoot.test.ts +99 -0
  69. package/src/__tests__/behavioral/onboard/StartingOnboarding.test.ts +2 -7
  70. package/src/__tests__/behavioral/permissions/SyncingPermissions.test.ts +185 -52
  71. package/src/__tests__/behavioral/{SettingRemote.test.ts → remote/SettingRemote.test.ts} +3 -3
  72. package/src/__tests__/behavioral/remote/SettingRemoteDoesNotAskTwice.test.ts +68 -0
  73. package/src/__tests__/behavioral/tests/CreatingATest.test.ts +1 -1
  74. package/src/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.ts +1 -1
  75. package/src/__tests__/behavioral/tests/TestingDataStores.test.ts +11 -3
  76. package/src/__tests__/support/EventFaker.ts +10 -0
  77. package/src/errors/SpruceError.ts +4 -0
  78. package/src/errors/agentAlreadyRegistered.builder.ts +14 -0
  79. package/src/features/ActionExecuter.ts +5 -4
  80. package/src/features/FeatureInstallerFactory.ts +3 -0
  81. package/src/features/agent/AgentFeature.ts +31 -0
  82. package/src/features/agent/actions/RegisterAction.ts +79 -0
  83. package/src/features/agent/stores/AgentStore.ts +16 -0
  84. package/src/features/agent/writers/AgentWriter.ts +54 -0
  85. package/src/features/event/EventFeature.ts +1 -0
  86. package/src/features/permission/writers/PermissionWriter.ts +11 -1
  87. package/src/stores/StoreFactory.ts +3 -0
  88. package/src/tests/buildTestCache.ts +9 -2
  89. package/src/tests/utilities/test.utility.ts +3 -3
  90. package/src/writers/WriterFactory.ts +3 -0
  91. package/build/__tests__/behavioral/SettingRemote.test.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [28.2.1](https://github.com/sprucelabsai-community/spruce-cli-workspace/compare/v28.2.0...v28.2.1) (2025-10-13)
7
+
8
+ **Note:** Version bump only for package @sprucelabs/spruce-cli
9
+
10
+
11
+
12
+
13
+
14
+ # [28.2.0](https://github.com/sprucelabsai-community/spruce-cli-workspace/compare/v28.1.4...v28.2.0) (2025-10-06)
15
+
16
+
17
+ ### Features
18
+
19
+ * agent registration ([4af127d](https://github.com/sprucelabsai-community/spruce-cli-workspace/commit/4af127d))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [28.1.4](https://github.com/sprucelabsai-community/spruce-cli-workspace/compare/v28.1.3...v28.1.4) (2025-10-02)
7
26
 
8
27
  **Note:** Version bump only for package @sprucelabs/spruce-cli
@@ -920,6 +920,28 @@ export declare namespace SpruceErrors.SpruceCli {
920
920
  }
921
921
  type AppControllerAlreadyExistsEntity = SchemaEntity<SpruceErrors.SpruceCli.AppControllerAlreadyExistsSchema>;
922
922
  }
923
+ export declare namespace SpruceErrors.SpruceCli {
924
+ interface AgentAlreadyRegistered {
925
+ /** Prompt Path. The path to the existing agent prompt file. */
926
+ 'promptPath': string;
927
+ }
928
+ interface AgentAlreadyRegisteredSchema extends SpruceSchema.Schema {
929
+ id: 'agentAlreadyRegistered';
930
+ namespace: 'SpruceCli';
931
+ name: 'agent already registered';
932
+ fields: {
933
+ /** Prompt Path. The path to the existing agent prompt file. */
934
+ 'promptPath': {
935
+ label: 'Prompt Path';
936
+ type: 'text';
937
+ isRequired: true;
938
+ hint: 'The path to the existing agent prompt file.';
939
+ options: undefined;
940
+ };
941
+ };
942
+ }
943
+ type AgentAlreadyRegisteredEntity = SchemaEntity<SpruceErrors.SpruceCli.AgentAlreadyRegisteredSchema>;
944
+ }
923
945
  export declare namespace SpruceErrors.SpruceCli {
924
946
  interface ActionCancelled {
925
947
  }
@@ -126,8 +126,11 @@ export interface BootErrorErrorOptions extends SpruceErrors.SpruceCli.BootError,
126
126
  export interface AppControllerAlreadyExistsErrorOptions extends SpruceErrors.SpruceCli.AppControllerAlreadyExists, ISpruceErrorOptions {
127
127
  code: 'APP_CONTROLLER_ALREADY_EXISTS';
128
128
  }
129
+ export interface AgentAlreadyRegisteredErrorOptions extends SpruceErrors.SpruceCli.AgentAlreadyRegistered, ISpruceErrorOptions {
130
+ code: 'AGENT_ALREADY_REGISTERED';
131
+ }
129
132
  export interface ActionCancelledErrorOptions extends SpruceErrors.SpruceCli.ActionCancelled, ISpruceErrorOptions {
130
133
  code: 'ACTION_CANCELLED';
131
134
  }
132
- type ErrorOptions = VscodeNotInstalledErrorOptions | ViewPluginAlreadyExistsErrorOptions | TransportAlreadyExistsErrorOptions | ThemeExistsErrorOptions | TestFailedErrorOptions | StoreExistsErrorOptions | SkillViewExistsErrorOptions | SkillNotRegisteredErrorOptions | SkillNotFoundErrorOptions | SchemaTemplateItemBuildingFailedErrorOptions | SchemaFailedToImportErrorOptions | SchemaExistsErrorOptions | NotLoggedInErrorOptions | NotImplementedErrorOptions | NoSkillsRegisteredErrorOptions | NoOrganizationsFoundErrorOptions | MissingDependenciesErrorOptions | MercuryResponseErrorErrorOptions | LintFailedErrorOptions | InvalidTestDirectoryErrorOptions | InvalidFeatureCodeErrorOptions | InvalidEventContractErrorOptions | InvalidCommandErrorOptions | GenericErrorOptions | FileExistsErrorOptions | FeatureNotInstalledErrorOptions | FailedToImportErrorOptions | ExecutingCommandFailedErrorOptions | DockerNotStartedErrorOptions | DirectoryNotSkillErrorOptions | DirectoryEmptyErrorOptions | DeployFailedErrorOptions | DependencyExistsErrorOptions | CreateAutoloaderFailedErrorOptions | CommandNotImplementedErrorOptions | CommandBlockedErrorOptions | CommandAbortedErrorOptions | CannotPromptInCiErrorOptions | CacheNotEnabledErrorOptions | BuildFailedErrorOptions | BootErrorErrorOptions | AppControllerAlreadyExistsErrorOptions | ActionCancelledErrorOptions;
135
+ type ErrorOptions = VscodeNotInstalledErrorOptions | ViewPluginAlreadyExistsErrorOptions | TransportAlreadyExistsErrorOptions | ThemeExistsErrorOptions | TestFailedErrorOptions | StoreExistsErrorOptions | SkillViewExistsErrorOptions | SkillNotRegisteredErrorOptions | SkillNotFoundErrorOptions | SchemaTemplateItemBuildingFailedErrorOptions | SchemaFailedToImportErrorOptions | SchemaExistsErrorOptions | NotLoggedInErrorOptions | NotImplementedErrorOptions | NoSkillsRegisteredErrorOptions | NoOrganizationsFoundErrorOptions | MissingDependenciesErrorOptions | MercuryResponseErrorErrorOptions | LintFailedErrorOptions | InvalidTestDirectoryErrorOptions | InvalidFeatureCodeErrorOptions | InvalidEventContractErrorOptions | InvalidCommandErrorOptions | GenericErrorOptions | FileExistsErrorOptions | FeatureNotInstalledErrorOptions | FailedToImportErrorOptions | ExecutingCommandFailedErrorOptions | DockerNotStartedErrorOptions | DirectoryNotSkillErrorOptions | DirectoryEmptyErrorOptions | DeployFailedErrorOptions | DependencyExistsErrorOptions | CreateAutoloaderFailedErrorOptions | CommandNotImplementedErrorOptions | CommandBlockedErrorOptions | CommandAbortedErrorOptions | CannotPromptInCiErrorOptions | CacheNotEnabledErrorOptions | BuildFailedErrorOptions | BootErrorErrorOptions | AppControllerAlreadyExistsErrorOptions | AgentAlreadyRegisteredErrorOptions | ActionCancelledErrorOptions;
133
136
  export default ErrorOptions;
@@ -0,0 +1,3 @@
1
+ import { SpruceErrors } from '../errors.types';
2
+ declare const agentAlreadyRegisteredSchema: SpruceErrors.SpruceCli.AgentAlreadyRegisteredSchema;
3
+ export default agentAlreadyRegisteredSchema;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_1 = require("@sprucelabs/schema");
4
+ const agentAlreadyRegisteredSchema = {
5
+ id: 'agentAlreadyRegistered',
6
+ namespace: 'SpruceCli',
7
+ name: 'agent already registered',
8
+ fields: {
9
+ /** Prompt Path. The path to the existing agent prompt file. */
10
+ 'promptPath': {
11
+ label: 'Prompt Path',
12
+ type: 'text',
13
+ isRequired: true,
14
+ hint: 'The path to the existing agent prompt file.',
15
+ options: undefined
16
+ },
17
+ }
18
+ };
19
+ schema_1.SchemaRegistry.getInstance().trackSchema(agentAlreadyRegisteredSchema);
20
+ exports.default = agentAlreadyRegisteredSchema;
21
+ //# sourceMappingURL=agentAlreadyRegistered.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentAlreadyRegistered.schema.js","sourceRoot":"","sources":["../../../../src/.spruce/errors/spruceCli/agentAlreadyRegistered.schema.ts"],"names":[],"mappings":";;AAAA,+CAAmD;AAKnD,MAAM,4BAA4B,GAAyD;IAC1F,EAAE,EAAE,wBAAwB;IAC5B,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,0BAA0B;IAC5B,MAAM,EAAE;QACA,+DAA+D;QAC/D,YAAY,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,6CAA6C;YACnD,OAAO,EAAE,SAAS;SACrB;KACR;CACL,CAAA;AAED,uBAAc,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAA;AAEtE,kBAAe,4BAA4B,CAAA"}
@@ -0,0 +1,15 @@
1
+ import AbstractSkillTest from '../../../tests/AbstractSkillTest';
2
+ export default class RegisteringAnAgentAtBootTest extends AbstractSkillTest {
3
+ protected static skillCacheKey: string;
4
+ private static agentName;
5
+ private static agents;
6
+ private static skills;
7
+ protected static beforeEach(): Promise<void>;
8
+ protected static canCreateRegisteringAnAgentAtBoot(): Promise<void>;
9
+ protected static bootingRegistersTheAgent(): Promise<void>;
10
+ protected static returnsAnErrorIfAlreadyRegistered(): Promise<void>;
11
+ private static register;
12
+ private static loginAndRegisterSkill;
13
+ private static boot;
14
+ private static getPlatformAgent;
15
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const test_utils_1 = require("@sprucelabs/test-utils");
13
+ const AbstractSkillTest_1 = __importDefault(require("../../../tests/AbstractSkillTest"));
14
+ class RegisteringAnAgentAtBootTest extends AbstractSkillTest_1.default {
15
+ static skillCacheKey = 'events';
16
+ static agentName = (0, test_utils_1.generateId)();
17
+ static agents;
18
+ static skills;
19
+ static async beforeEach() {
20
+ await super.beforeEach();
21
+ this.agents = this.Store('agent');
22
+ this.skills = this.Store('skill');
23
+ }
24
+ static async canCreateRegisteringAnAgentAtBoot() {
25
+ const results = await this.register();
26
+ const expectedPlugin = this.resolvePath('src', '.spruce', 'features', 'agent.plugin.ts');
27
+ const expectedPrompt = this.resolvePath('agents/SYSTEM_PROMPT.md');
28
+ test_utils_1.assert.isEqualDeep(results.files, [
29
+ {
30
+ path: expectedPlugin,
31
+ name: 'agent.plugin.ts',
32
+ action: 'generated',
33
+ description: 'Supports your skill with registering ai agents.',
34
+ },
35
+ {
36
+ path: expectedPrompt,
37
+ name: 'SYSTEM_PROMPT.md',
38
+ action: 'generated',
39
+ description: `The prompt file that defines how your AI Platform Agent behaves.`,
40
+ },
41
+ ]);
42
+ }
43
+ static async bootingRegistersTheAgent() {
44
+ await this.loginAndRegisterSkill();
45
+ await this.boot();
46
+ const agent = await this.getPlatformAgent();
47
+ test_utils_1.assert.isTruthy(agent, 'Did not register an agent at boot.');
48
+ test_utils_1.assert.isEqual(agent.name, this.agentName, 'Did not set name correctly.');
49
+ }
50
+ static async returnsAnErrorIfAlreadyRegistered() {
51
+ const results = await this.register();
52
+ test_utils_1.assert.isFalsy(results.files, 'Should not have created files.');
53
+ test_utils_1.assert.isTruthy(results.errors, 'Should have errors.');
54
+ }
55
+ static async register() {
56
+ return await this.Action('agent', 'register', {
57
+ shouldAutoHandleDependencies: true,
58
+ }).execute({
59
+ type: 'system',
60
+ name: this.agentName,
61
+ });
62
+ }
63
+ static async loginAndRegisterSkill() {
64
+ await this.people.loginAsDemoPerson();
65
+ await this.skills.register({
66
+ name: 'Agent skill',
67
+ });
68
+ }
69
+ static async boot() {
70
+ await this.Action('skill', 'boot').execute({
71
+ local: true,
72
+ onData: (data) => {
73
+ this.log(`Boot Log: ${data}`);
74
+ },
75
+ onError: (data) => {
76
+ this.log(`Boot Error: ${data}`);
77
+ },
78
+ });
79
+ }
80
+ static async getPlatformAgent() {
81
+ return await this.agents.getPlatformAgent();
82
+ }
83
+ }
84
+ exports.default = RegisteringAnAgentAtBootTest;
85
+ __decorate([
86
+ (0, test_utils_1.test)()
87
+ ], RegisteringAnAgentAtBootTest, "canCreateRegisteringAnAgentAtBoot", null);
88
+ __decorate([
89
+ (0, test_utils_1.test)()
90
+ ], RegisteringAnAgentAtBootTest, "bootingRegistersTheAgent", null);
91
+ __decorate([
92
+ (0, test_utils_1.test)()
93
+ ], RegisteringAnAgentAtBootTest, "returnsAnErrorIfAlreadyRegistered", null);
94
+ //# sourceMappingURL=RegisteringAnAgentAtBoot.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RegisteringAnAgentAtBoot.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/agents/R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O,EAAE,CAAC,IAAY,EAAE,EAAE;gBACtB,IAAI,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC,CAAA;YACnC,CAAC;SACJ,CAAC,CAAA;IACN,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,gBAAgB;QACjC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAA;IAC/C,CAAC;;AA5FL,+CA6FC;AAhF0B;IADtB,IAAA,iBAAI,GAAE;2EA0BN;AAGsB;IADtB,IAAA,iBAAI,GAAE;kEAaN;AAGsB;IADtB,IAAA,iBAAI,GAAE;2EAKN"}
@@ -69,19 +69,12 @@ class StartingOnboardingTest extends AbstractCliTest_1.default {
69
69
  const onboardPromise = onboardAction.execute({});
70
70
  // get through first onboarding script and select short onboarding
71
71
  await this.waitForInput();
72
- debugger;
73
72
  await this.ui.sendInput('\n');
74
- debugger;
75
73
  await this.waitForInput();
76
- debugger;
77
74
  await this.ui.sendInput('immersive');
78
- debugger;
79
75
  await this.waitForInput();
80
- debugger;
81
76
  await this.ui.sendInput('\n');
82
- debugger;
83
77
  await onboardPromise;
84
- debugger;
85
78
  const onboardingStore = this.Store('onboarding');
86
79
  test_utils_1.assert.isEqual(onboardingStore.getMode(), 'immersive');
87
80
  const createSkillAction = this.Action('skill', 'create', {
@@ -1 +1 @@
1
- {"version":3,"file":"StartingOnboarding.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/onboard/StartingOnboarding.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAqD;AACrD,wEAAyE;AACzE,sFAAiE;AACjE,qFAA4D;AAE5D,MAAM,UAAW,SAAQ,uBAAgB;IAC9B,MAAM,CAAC,WAAW;QACrB,OAAO,IAAI,UAAU,CAAC,8BAAc,CAAC,CAAA;IACzC,CAAC;IAEM,YAAY,CAAC,SAAiB;QACjC,OAAO,CAAC,CAAC,IAAI,CAAC,gBAAg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6 +3,7 @@ export default class SyncingPermissionsTest extends AbstractPermissionsTest {
3
3
  private static syncAction;
4
4
  private static contractId1;
5
5
  private static contractId2;
6
+ private static heartwoodSkill;
6
7
  protected static beforeAll(): Promise<void>;
7
8
  protected static beforeEach(): Promise<void>;
8
9
  protected static generatesExpectedTypesFile(): Promise<void>;
@@ -13,6 +14,12 @@ export default class SyncingPermissionsTest extends AbstractPermissionsTest {
13
14
  protected static combinedFileImportsAllPermissions(): Promise<void>;
14
15
  protected static canSyncCorePermissions(): Promise<void>;
15
16
  protected static syncingEventsSyncsPermissions(): Promise<void>;
17
+ protected static permsSentInAlphabeticalOrder(): Promise<void>;
18
+ private static fakeHeartwoodPermContracts;
19
+ private static import;
20
+ private static addHeartwoodAsDependency;
21
+ private static readTypesFile;
22
+ private static getTypesPath;
16
23
  private static getCombinedPath;
17
24
  private static beginTrackingExecute;
18
25
  private static sync;
@@ -17,15 +17,20 @@ const SyncAction_1 = __importDefault(require("../../../features/permission/actio
17
17
  const test_utility_1 = __importDefault(require("../../../tests/utilities/test.utility"));
18
18
  const AbstractPermissionsTest_1 = __importDefault(require("./support/AbstractPermissionsTest"));
19
19
  const generateShortAlphaId_1 = __importDefault(require("./support/generateShortAlphaId"));
20
- const sortPermissionContracts_1 = require("./support/sortPermissionContracts");
21
20
  class SyncingPermissionsTest extends AbstractPermissionsTest_1.default {
22
21
  static syncAction;
23
22
  static contractId1;
24
23
  static contractId2;
24
+ static heartwoodSkill = {
25
+ id: (0, test_utils_1.generateId)(),
26
+ slug: 'heartwood',
27
+ dateCreated: 0,
28
+ name: 'Heartwood',
29
+ };
25
30
  static async beforeAll() {
26
31
  await super.beforeAll();
27
- this.contractId1 = (0, generateShortAlphaId_1.default)();
28
- this.contractId2 = (0, generateShortAlphaId_1.default)();
32
+ this.contractId1 = 'b-should-be-second' + (0, generateShortAlphaId_1.default)();
33
+ this.contractId2 = 'a-should-be-first' + (0, generateShortAlphaId_1.default)();
29
34
  }
30
35
  static async beforeEach() {
31
36
  await super.beforeEach();
@@ -33,10 +38,13 @@ class SyncingPermissionsTest extends AbstractPermissionsTest_1.default {
33
38
  mercury_client_1.MercuryClientFactory.setIsTestMode(true);
34
39
  ExecuteTrackingAction.wasExecuteInvoked = false;
35
40
  await this.eventFaker.fakeListPermissionContracts();
41
+ await this.eventFaker.fakeListSkills(() => {
42
+ return [this.heartwoodSkill];
43
+ });
36
44
  }
37
45
  static async generatesExpectedTypesFile() {
38
46
  const results = await this.sync();
39
- const expected = this.resolveHashSprucePath(`permissions/permissions.types.ts`);
47
+ const expected = this.getTypesPath();
40
48
  test_utility_1.default.assertFileByPathInGeneratedFiles(expected, results.files);
41
49
  }
42
50
  static async syncsNewPermissionsWhenMade() {
@@ -59,11 +67,11 @@ class SyncingPermissionsTest extends AbstractPermissionsTest_1.default {
59
67
  }
60
68
  static async combinedFileImportsAllPermissions() {
61
69
  await this.createPermissionContract(this.contractId2);
62
- const imported = await this.Service('import').importDefault(this.getCombinedPath());
63
- test_utils_1.assert.isEqualDeep(imported.sort(sortPermissionContracts_1.sortPermissionContracts), [
70
+ const imported = await this.import();
71
+ test_utils_1.assert.isEqualDeep(imported, [
64
72
  {
65
- id: this.contractId1,
66
- name: this.contractId1,
73
+ id: this.contractId2,
74
+ name: this.contractId2,
67
75
  description: '',
68
76
  requireAllPermissions: false,
69
77
  permissions: [
@@ -77,8 +85,8 @@ class SyncingPermissionsTest extends AbstractPermissionsTest_1.default {
77
85
  ],
78
86
  },
79
87
  {
80
- id: this.contractId2,
81
- name: this.contractId2,
88
+ id: this.contractId1,
89
+ name: this.contractId1,
82
90
  description: '',
83
91
  requireAllPermissions: false,
84
92
  permissions: [
@@ -91,7 +99,7 @@ class SyncingPermissionsTest extends AbstractPermissionsTest_1.default {
91
99
  },
92
100
  ],
93
101
  },
94
- ].sort(sortPermissionContracts_1.sortPermissionContracts));
102
+ ]);
95
103
  }
96
104
  static async canSyncCorePermissions() {
97
105
  let wasHit = false;
@@ -101,8 +109,8 @@ class SyncingPermissionsTest extends AbstractPermissionsTest_1.default {
101
109
  wasHit = true;
102
110
  });
103
111
  await this.sync({ shouldSyncCorePermissions: true });
104
- test_utils_1.assert.isTrue(wasHit);
105
- test_utils_1.assert.isUndefined(passedTarget);
112
+ test_utils_1.assert.isTrue(wasHit, 'Did not emit list-permission-contracts event');
113
+ test_utils_1.assert.isUndefined(passedTarget, 'Should not have passed a target to list-permission-contracts');
106
114
  }
107
115
  static async syncingEventsSyncsPermissions() {
108
116
  this.beginTrackingExecute();
@@ -113,6 +121,95 @@ class SyncingPermissionsTest extends AbstractPermissionsTest_1.default {
113
121
  });
114
122
  test_utils_1.assert.isTrue(ExecuteTrackingAction.wasExecuteInvoked);
115
123
  }
124
+ static async permsSentInAlphabeticalOrder() {
125
+ await this.addHeartwoodAsDependency();
126
+ await this.fakeHeartwoodPermContracts();
127
+ await this.sync();
128
+ const contents = this.readTypesFile();
129
+ const firstId = contents.indexOf('perk-a-should-be-first');
130
+ const secondId = contents.indexOf('perk-should-be-second');
131
+ const thirdId = contents.indexOf('perl-a-should-be-first');
132
+ const fourthId = contents.indexOf('perl-should-be-second');
133
+ const fifthId = contents.indexOf('perm-a-should-be-first');
134
+ const sixthId = contents.indexOf('perm-should-be-second');
135
+ test_utils_1.assert.isTrue(firstId < secondId, 'Permissions are not in alphabetical order');
136
+ test_utils_1.assert.isTrue(secondId < thirdId, 'Permissions are not in alphabetical order');
137
+ test_utils_1.assert.isTrue(thirdId < fourthId, 'Permissions are not in alphabetical order');
138
+ test_utils_1.assert.isTrue(fourthId < fifthId, 'Permissions are not in alphabetical order');
139
+ test_utils_1.assert.isTrue(fifthId < sixthId, 'Permissions are not in alphabetical order');
140
+ }
141
+ static async fakeHeartwoodPermContracts() {
142
+ await this.eventFaker.fakeListPermissionContracts(() => {
143
+ return [
144
+ {
145
+ id: 'ab-' + (0, generateShortAlphaId_1.default)(),
146
+ contract: {
147
+ id: 'ab-' + (0, generateShortAlphaId_1.default)(),
148
+ name: (0, test_utils_1.generateId)(),
149
+ permissions: [
150
+ {
151
+ id: 'perl-should-be-second',
152
+ name: 'Should be second',
153
+ },
154
+ {
155
+ id: 'perl-a-should-be-first',
156
+ name: 'Should be first',
157
+ },
158
+ ],
159
+ },
160
+ },
161
+ {
162
+ id: 'ba-' + (0, generateShortAlphaId_1.default)(),
163
+ contract: {
164
+ id: 'ba-' + (0, generateShortAlphaId_1.default)(),
165
+ name: (0, test_utils_1.generateId)(),
166
+ permissions: [
167
+ {
168
+ id: 'perm-should-be-second',
169
+ name: 'Should be second',
170
+ },
171
+ {
172
+ id: 'perm-a-should-be-first',
173
+ name: 'Should be first',
174
+ },
175
+ ],
176
+ },
177
+ },
178
+ {
179
+ id: 'aa-' + (0, generateShortAlphaId_1.default)(),
180
+ contract: {
181
+ id: 'aa-' + (0, generateShortAlphaId_1.default)(),
182
+ name: (0, test_utils_1.generateId)(),
183
+ permissions: [
184
+ {
185
+ id: 'perk-should-be-second',
186
+ name: 'Should be second',
187
+ },
188
+ {
189
+ id: 'perk-a-should-be-first',
190
+ name: 'Should be first',
191
+ },
192
+ ],
193
+ },
194
+ },
195
+ ];
196
+ });
197
+ }
198
+ static async import() {
199
+ return await this.Service('import').importDefault(this.getCombinedPath());
200
+ }
201
+ static async addHeartwoodAsDependency() {
202
+ const results = await this.Action('dependency', 'add').execute({
203
+ namespace: 'heartwood',
204
+ });
205
+ test_utils_1.assert.isFalsy(results.errors, 'Should not have errored');
206
+ }
207
+ static readTypesFile() {
208
+ return spruce_skill_utils_1.diskUtil.readFile(this.getTypesPath());
209
+ }
210
+ static getTypesPath() {
211
+ return this.resolveHashSprucePath(`permissions/permissions.types.ts`);
212
+ }
116
213
  static getCombinedPath() {
117
214
  return this.resolveHashSprucePath('permissions', 'permissions.ts');
118
215
  }
@@ -120,7 +217,9 @@ class SyncingPermissionsTest extends AbstractPermissionsTest_1.default {
120
217
  ActionFactory_1.default.setActionClass('permission', 'sync', ExecuteTrackingAction);
121
218
  }
122
219
  static async sync(options) {
123
- return await this.syncAction.execute(options);
220
+ const results = await this.syncAction.execute(options);
221
+ test_utils_1.assert.isFalsy(results.errors, 'Should not have errored when syncing permissions');
222
+ return results;
124
223
  }
125
224
  static async emitDidExecuteUpgrade() {
126
225
  await this.emitter.emitAndFlattenResponses('feature.did-execute', {
@@ -155,6 +254,9 @@ __decorate([
155
254
  __decorate([
156
255
  (0, test_utils_1.test)()
157
256
  ], SyncingPermissionsTest, "syncingEventsSyncsPermissions", null);
257
+ __decorate([
258
+ (0, test_utils_1.test)()
259
+ ], SyncingPermissionsTest, "permsSentInAlphabeticalOrder", null);
158
260
  class ExecuteTrackingAction extends SyncAction_1.default {
159
261
  static wasExecuteInvoked = false;
160
262
  async execute() {
@@ -1 +1 @@
1
- {"version":3,"file":"SyncingPermissions.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/permissions/SyncingPermissions.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAiE;AACjE,uEAAyD;AACzD,uDAAqD;AACrD,oFAA2D;AAC3D,iGAEwD;AAExD,yFAA4D;AAC5D,gGAAuE;AACvE,0FAAiE;AACjE,+EAA2E;AAE3E,MAAqB,sBAAuB,SAAQ,iCAAuB;IAC/D,MAAM,CAAC,UAAU,CAAY;IAC7B,MAAM,CAAC,WAAW,CAAQ;IAC1B,MAAM,CAAC,WAAW,CAAQ;IAExB,MAAM,CAAC,KAAK,CAAC,SAAS;QAC5B,MAAM,KAAK,CAAC,SAAS,EAAE,CAAA;QACvB,IAAI,CAAC,WAAW,GAAG,IAAA,8BAAoB,GAAE,CAAA;QACzC,IAAI,CAAC,WAAW,GAAG,IAAA,8BAAoB,GAAE,CAAA;IAC7C,CAAC;IAES,MAAM,CAAC,KAAK,CAAC,UAAU;QAC7B,MAAM,KAAK,CAAC,UAAU,EAAE,CAAA;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;QACnD,qCAAoB,CAA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AC,CAAA;IACN,CAAC;CACJ;AA7JD,yCA6JC;AAzI0B;IADtB,IAAA,iBAAI,GAAE;8DASN;AAGsB;IADtB,IAAA,iBAAI,GAAE;+DAMN;AAGsB;IADtB,IAAA,iBAAI,GAAE;6DAKN;AAGsB;IADtB,IAAA,iBAAI,GAAE;6DAON;AAGsB;IADtB,IAAA,iBAAI,GAAE;yDAGN;AAGsB;IADtB,IAAA,iBAAI,GAAE;qEA6CN;AAGsB;IADtB,IAAA,iBAAI,GAAE;0DAeN;AAGsB;IADtB,IAAA,iBAAI,GAAE;iEASN;AA2BL,MAAM,qBAAsB,SAAQ,oBAAU;IACnC,MAAM,CAAC,iBAAiB,GAAG,KAAK,CAAA;IAChC,KAAK,CAAC,OAAO;QAChB,qBAAqB,CAAC,iBAAiB,GAAG,IAAI,CAAA;QAC9C,OAAO,EAAE,CAAA;IACb,CAAC"}
1
+ {"version":3,"file":"SyncingPermissions.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/permissions/SyncingPermissions.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAiE;AACjE,uEAAyD;AACzD,uDAAiE;AACjE,oFAA2D;AAC3D,iGAEwD;AAExD,yFAA4D;AAE5D,gGAAuE;AACvE,0FAAiE;AAEjE,MAAqB,sBAAuB,SAAQ,iCAAuB;IAC/D,MAAM,CAAC,UAAU,CAAY;IAC7B,MAAM,CAAC,WAAW,CAAQ;IAC1B,MAAM,CAAC,WAAW,CAAQ;IAC1B,MAAM,CAAC,cAAc,GAAc;QACvC,EAAE,EAAE,IAAA,uBAAU,GAAE;QAChB,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,CAAC;QACd,IAAI,EAAE,WAAW;KACpB,CAAA;IAES,MAAM,CAAC,KAAK,CAAC,SAAS;QAC5B,MAAM,KAAK,CAAC,SAAS,EAAE,CAAA;QACvB,IAAI,CAAC,WAAW,GAAG,oBAAoB,GAAG,IAAA,8BAAoB,GAAE,CAAA;QAChE,IAAI,CA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;IACnC,MAAM,CAAC,iBAAiB,GAAG,KAAK,CAAA;IAChC,KAAK,CAAC,OAAO;QAChB,qBAAqB,CAAC,iBAAiB,GAAG,IAAI,CAAA;QAC9C,OAAO,EAAE,CAAA;IACb,CAAC"}
@@ -1,5 +1,5 @@
1
- import { FeatureCode } from '../../features/features.types';
2
- import AbstractSkillTest from '../../tests/AbstractSkillTest';
1
+ import { FeatureCode } from '../../../features/features.types';
2
+ import AbstractSkillTest from '../../../tests/AbstractSkillTest';
3
3
  export default class SettingRemoteTest extends AbstractSkillTest {
4
4
  protected static skillCacheKey: string;
5
5
  protected static hasSetRemoteAction(): Promise<void>;
@@ -11,8 +11,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
13
13
  const test_utils_1 = require("@sprucelabs/test-utils");
14
- const TerminalInterface_1 = __importDefault(require("../../interfaces/TerminalInterface"));
15
- const AbstractSkillTest_1 = __importDefault(require("../../tests/AbstractSkillTest"));
14
+ const TerminalInterface_1 = __importDefault(require("../../../interfaces/TerminalInterface"));
15
+ const AbstractSkillTest_1 = __importDefault(require("../../../tests/AbstractSkillTest"));
16
16
  class SettingRemoteTest extends AbstractSkillTest_1.default {
17
17
  static skillCacheKey = 'events';
18
18
  static async hasSetRemoteAction() {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingRemote.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/remote/SettingRemote.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uEAKuC;AACvC,uDAAqD;AAErD,8FAAqE;AACrE,yFAAgE;AAEhE,MAAqB,iBAAkB,SAAQ,2BAAiB;IAClD,MAAM,CAAC,aAAa,GAAG,QAAQ,CAAA;IAGlB,AAAb,MAAM,CAAC,KAAK,CAAC,kBAAkB;QACrC,mBAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EA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QpE;AAMsB;IAJtB,IAAA,iBAAI,EAAC,wCAAwC,EAAE,OAAO,EAAE,QAAQ,CAAC;IACjE,IAAA,iBAAI,EAAC,uCAAuC,EAAE,OAAO,EAAE,MAAM,CAAC;IAC9D,IAAA,iBAAI,EAAC,iCAAiC,EAAE,QAAQ,EAAE,OAAO,CAAC;IAC1D,IAAA,iBAAI,EAAC,uCAAuC,EAAE,OAAO,EAAE,OAAO,CAAC;+FAqB/D;AAIsB;IAFtB,IAAA,iBAAI,EAAC,2CAA2C,EAAE,QAAQ,EAAE,KAAK,CAAC;IAClE,IAAA,iBAAI,EAAC,0CAA0C,EAAE,MAAM,EAAE,KAAK,CAAC;wFAc/D;AAGsB;IADtB,IAAA,iBAAI,GAAE;wEAON"}
@@ -0,0 +1,10 @@
1
+ import AbstractSkillTest from '../../../tests/AbstractSkillTest';
2
+ export default class SettingRemoteDoesNotAskTwiceTest extends AbstractSkillTest {
3
+ protected static skillCacheKey: string;
4
+ protected static canSetRemoteWithoutOneAndOnlyBeAskedOnce(): Promise<void>;
5
+ private static confirmFinishedInstallingDependencies;
6
+ private static confirmInstallPermissionFeature;
7
+ private static confirmInstallSchemaFeature;
8
+ private static pressEnter;
9
+ private static cleanEnv;
10
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
13
+ const test_utils_1 = require("@sprucelabs/test-utils");
14
+ const RemoteService_1 = __importDefault(require("../../../features/event/services/RemoteService"));
15
+ const ServiceFactory_1 = __importDefault(require("../../../services/ServiceFactory"));
16
+ const AbstractSkillTest_1 = __importDefault(require("../../../tests/AbstractSkillTest"));
17
+ class SettingRemoteDoesNotAskTwiceTest extends AbstractSkillTest_1.default {
18
+ static skillCacheKey = 'tests';
19
+ static async canSetRemoteWithoutOneAndOnlyBeAskedOnce() {
20
+ ServiceFactory_1.default.setServiceClass('remote', CountingRemoteService);
21
+ this.cleanEnv();
22
+ const promise = this.Action('event', 'setRemote', {
23
+ shouldAutoHandleDependencies: true,
24
+ }).execute({});
25
+ await this.confirmInstallSchemaFeature();
26
+ await this.confirmInstallPermissionFeature();
27
+ await this.confirmFinishedInstallingDependencies();
28
+ await this.waitForInput();
29
+ await this.ui.sendInput('local');
30
+ await promise;
31
+ }
32
+ static async confirmFinishedInstallingDependencies() {
33
+ await this.waitForInput();
34
+ await this.pressEnter();
35
+ }
36
+ static async confirmInstallPermissionFeature() {
37
+ await this.waitForInput();
38
+ await this.pressEnter();
39
+ }
40
+ static async confirmInstallSchemaFeature() {
41
+ await this.waitForInput();
42
+ await this.pressEnter();
43
+ }
44
+ static async pressEnter() {
45
+ await this.ui.sendInput('\n');
46
+ }
47
+ static cleanEnv() {
48
+ const envPath = this.resolvePath('.env');
49
+ spruce_skill_utils_1.diskUtil.deleteFile(envPath);
50
+ spruce_skill_utils_1.diskUtil.writeFile(envPath, 'SKILL_NAME="don\'t double me"');
51
+ }
52
+ }
53
+ exports.default = SettingRemoteDoesNotAskTwiceTest;
54
+ __decorate([
55
+ (0, test_utils_1.test)()
56
+ ], SettingRemoteDoesNotAskTwiceTest, "canSetRemoteWithoutOneAndOnlyBeAskedOnce", null);
57
+ class CountingRemoteService extends RemoteService_1.default {
58
+ static wasCalled = false;
59
+ set(host) {
60
+ if (CountingRemoteService.wasCalled) {
61
+ throw new Error('Called twice');
62
+ }
63
+ super.set(host);
64
+ CountingRemoteService.wasCalled = true;
65
+ }
66
+ }
67
+ //# sourceMappingURL=SettingRemoteDoesNotAskTwice.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingRemoteDoesNotAskTwice.test.js","sourceRoot":"","sources":["../../../../src/__tests__/behavioral/remote/SettingRemoteDoesNotAskTwice.test.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,uEAAyD;AACzD,uDAA6C;AAC7C,mGAA0E;AAC1E,sFAA6D;AAC7D,yFAAgE;AAEhE,MAAqB,gCAAiC,SAAQ,2BAAiB;IACjE,MAAM,CAAC,aAAa,GAAG,OAAO,CAAA;IAEjB,AAAb,MAAM,CAAC,KAAK,CAAC,wCAAwC;QAC3D,wBAAc,CAAC,eAAe,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAA;QAE/D,IAAI,CAAC,QAAQ,EAAE,CAAA;QAEf,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE;YAC9C,4BAA4B,EAAE,IAAI;SACrC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAEd,MAAM,IAAI,CAAC,2BAA2B,EAAE,CAAA;QACxC,MAAM,IAAI,CAAC,+BAA+B,EAAE,CAAA;QAE5C,MAAM,IAAI,CAAC,qCAAqC,EAAE,CAAA;QAClD,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;QAEzB,MAAM,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QAEhC,MAAM,OAAO,CAAA;IACjB,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,qCAAqC;QACtD,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;QACzB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;IAC3B,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,+BAA+B;QAChD,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;QACzB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;IAC3B,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,2BAA2B;QAC5C,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;QACzB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;IAC3B,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,UAAU;QAC3B,MAAM,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;IAEO,MAAM,CAAC,QAAQ;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QACxC,6BAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QAC5B,6BAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,+BAA+B,CAAC,CAAA;IAChE,CAAC;;AA9CL,mDA+CC;AA5C0B;IADtB,IAAA,iBAAI,GAAE;sFAmBN;AA4BL,MAAM,qBAAsB,SAAQ,uBAAa;IACtC,MAAM,CAAC,SAAS,GAAG,KAAK,CAAA;IACxB,GAAG,CAAC,IAAY;QACnB,IAAI,qBAAqB,CAAC,SAAS,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;QACnC,CAAC;QAED,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAEf,qBAAqB,CAAC,SAAS,GAAG,IAAI,CAAA;IAC1C,CAAC"}
@@ -33,7 +33,7 @@ class CreatingBehavioralTestsTest extends AbstractTestTest_1.default {
33
33
  const match = await this.createTestAndGetFile(testName);
34
34
  test_utils_1.assert.doesInclude(match, 'behavioral');
35
35
  await this.Service('build').build();
36
- await test_utils_1.assert.doesThrowAsync(() => this.Service('command').execute('yarn test'), /false.*?does not equal.*?true/gis);
36
+ await test_utils_1.assert.doesThrowAsync(() => this.Service('command').execute('yarn test'), /Expected:.*?false/gis);
37
37
  }
38
38
  static async promptsToSelectFolderIfInsideTestDir(testType) {
39
39
  await this.installTests();