@sprucelabs/spruce-cli 17.1.38 → 17.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/build/__tests__/behavioral/AddingADependency.test.js +10 -12
- package/build/__tests__/behavioral/AddingADependency.test.js.map +1 -1
- package/build/__tests__/behavioral/BlockingCommands.test.js +3 -5
- package/build/__tests__/behavioral/BlockingCommands.test.js.map +1 -1
- package/build/__tests__/behavioral/BootingTheCli.test.js +3 -3
- package/build/__tests__/behavioral/BootingTheCli.test.js.map +1 -1
- package/build/__tests__/behavioral/BootingWithBadFiles.test.js +7 -7
- package/build/__tests__/behavioral/BootingWithBadFiles.test.js.map +1 -1
- package/build/__tests__/behavioral/CreatingAConversationTopic.test.js +13 -13
- package/build/__tests__/behavioral/CreatingAConversationTopic.test.js.map +1 -1
- package/build/__tests__/behavioral/CreatingSchemasWithGenerics.test.js +10 -10
- package/build/__tests__/behavioral/CreatingSchemasWithGenerics.test.js.map +1 -1
- package/build/__tests__/behavioral/DeployingASkill.test.js +32 -34
- package/build/__tests__/behavioral/DeployingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/DeployingToSandbox.test.js +15 -17
- package/build/__tests__/behavioral/DeployingToSandbox.test.js.map +1 -1
- package/build/__tests__/behavioral/EnablingAndDisablingCache.test.js +11 -13
- package/build/__tests__/behavioral/EnablingAndDisablingCache.test.js.map +1 -1
- package/build/__tests__/behavioral/GettingCliVersion.test.js +4 -4
- package/build/__tests__/behavioral/GettingCliVersion.test.js.map +1 -1
- package/build/__tests__/behavioral/InstallingASkillAtAnOrg.test.js +11 -13
- package/build/__tests__/behavioral/InstallingASkillAtAnOrg.test.js.map +1 -1
- package/build/__tests__/behavioral/ListeningToCoreEvents.test.js +4 -4
- package/build/__tests__/behavioral/ListeningToCoreEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/LoggingInAsASkill.test.js +14 -16
- package/build/__tests__/behavioral/LoggingInAsASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/ManagingDependencies.test.js +9 -9
- package/build/__tests__/behavioral/ManagingDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/OverridingCommandsInPackageJson.test.js +3 -3
- package/build/__tests__/behavioral/OverridingCommandsInPackageJson.test.js.map +1 -1
- package/build/__tests__/behavioral/RebuildingASkill.test.js +4 -6
- package/build/__tests__/behavioral/RebuildingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/RegisteringConversationsOnBoot.test.js +4 -4
- package/build/__tests__/behavioral/RegisteringConversationsOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/RegisteringEventsOnBoot.test.js +7 -7
- package/build/__tests__/behavioral/RegisteringEventsOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/RegisteringGlobalEvents.test.js +11 -11
- package/build/__tests__/behavioral/RegisteringGlobalEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/RegisteringSkillViewOnBoot.test.js +6 -6
- package/build/__tests__/behavioral/RegisteringSkillViewOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/RememberingUpgradeSelections.test.js +5 -5
- package/build/__tests__/behavioral/RememberingUpgradeSelections.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingLogTransportsInASkill.test.js +10 -12
- package/build/__tests__/behavioral/SettingLogTransportsInASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingRemote.test.js +9 -9
- package/build/__tests__/behavioral/SettingRemote.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingUpASkillForTesting.test.js +10 -10
- package/build/__tests__/behavioral/SettingUpASkillForTesting.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingUpSchemasForModuleDistribution.test.js +29 -31
- package/build/__tests__/behavioral/SettingUpSchemasForModuleDistribution.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingUpVscode.test.js +10 -10
- package/build/__tests__/behavioral/SettingUpVscode.test.js.map +1 -1
- package/build/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.js +13 -13
- package/build/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/TestReporterSettingsRemembered.test.js +6 -6
- package/build/__tests__/behavioral/TestReporterSettingsRemembered.test.js.map +1 -1
- package/build/__tests__/behavioral/TestingAConversation.test.js +17 -17
- package/build/__tests__/behavioral/TestingAConversation.test.js.map +1 -1
- package/build/__tests__/behavioral/TestingDataStores.test.js +13 -13
- package/build/__tests__/behavioral/TestingDataStores.test.js.map +1 -1
- package/build/__tests__/behavioral/WatchingSkillViews.test.js +15 -15
- package/build/__tests__/behavioral/WatchingSkillViews.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/CreatingANewErrorBuilder.test.js +15 -15
- package/build/__tests__/behavioral/errors/CreatingANewErrorBuilder.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/KeepingErrorClassInSync.test.js +8 -8
- package/build/__tests__/behavioral/errors/KeepingErrorClassInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/KeepingErrorsInSync.test.js +32 -32
- package/build/__tests__/behavioral/errors/KeepingErrorsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/SettingUpErrors.test.js +4 -6
- package/build/__tests__/behavioral/errors/SettingUpErrors.test.js.map +1 -1
- package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js +25 -25
- package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js.map +1 -1
- package/build/__tests__/behavioral/events/CreatingAListener.test.js +29 -31
- package/build/__tests__/behavioral/events/CreatingAListener.test.js.map +1 -1
- package/build/__tests__/behavioral/events/CreatingAnEvent.test.js +26 -28
- package/build/__tests__/behavioral/events/CreatingAnEvent.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingEventsInSync.test.js +22 -22
- package/build/__tests__/behavioral/events/KeepingEventsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingEventsInSync2.test.js +38 -38
- package/build/__tests__/behavioral/events/KeepingEventsInSync2.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingListenersInSync.test.js +7 -7
- package/build/__tests__/behavioral/events/KeepingListenersInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.js +6 -6
- package/build/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SettingUpEvents.test.js +4 -4
- package/build/__tests__/behavioral/events/SettingUpEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js +3 -5
- package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/node/CreatingANodeModule.test.js +6 -6
- package/build/__tests__/behavioral/node/CreatingANodeModule.test.js.map +1 -1
- package/build/__tests__/behavioral/onboard/StartingOnboarding.test.js +6 -6
- package/build/__tests__/behavioral/onboard/StartingOnboarding.test.js.map +1 -1
- package/build/__tests__/behavioral/organization/CreatingAnOrg.test.js +6 -6
- package/build/__tests__/behavioral/organization/CreatingAnOrg.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js +3 -3
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js.map +1 -1
- package/build/__tests__/behavioral/person/LoggingInAsPerson.test.js +14 -16
- package/build/__tests__/behavioral/person/LoggingInAsPerson.test.js.map +1 -1
- package/build/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.js +7 -7
- package/build/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.js.map +1 -1
- package/build/__tests__/behavioral/polish/SettingUpPolish.test.js +8 -8
- package/build/__tests__/behavioral/polish/SettingUpPolish.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/CreatingANewSchemaBuilder.test.js +23 -25
- package/build/__tests__/behavioral/schemas/CreatingANewSchemaBuilder.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/GeneratingFieldTypesOnly.test.js +7 -7
- package/build/__tests__/behavioral/schemas/GeneratingFieldTypesOnly.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.js +6 -6
- package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/HandlesRelatedSchemas.test.js +18 -18
- package/build/__tests__/behavioral/schemas/HandlesRelatedSchemas.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/ImportingSchemaImports.test.js +7 -7
- package/build/__tests__/behavioral/schemas/ImportingSchemaImports.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/KeepingSchemasInSync.test.js +62 -64
- package/build/__tests__/behavioral/schemas/KeepingSchemasInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/SettingUpSchemas.test.js +6 -8
- package/build/__tests__/behavioral/schemas/SettingUpSchemas.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/SyncingBadSchemasProvidesHelpfulErrorMessages.test.js +4 -6
- package/build/__tests__/behavioral/schemas/SyncingBadSchemasProvidesHelpfulErrorMessages.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/UsingSchemasInCli.test.d.ts +1 -1
- package/build/__tests__/behavioral/schemas/UsingSchemasInCli.test.js +4 -4
- package/build/__tests__/behavioral/schemas/UsingSchemasInCli.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/BootingASkill.test.js +12 -12
- package/build/__tests__/behavioral/skill/BootingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/CreatingASkill.test.js +5 -5
- package/build/__tests__/behavioral/skill/CreatingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/RegisteringASkill.test.js +12 -14
- package/build/__tests__/behavioral/skill/RegisteringASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/SettingUpASkill.test.js +29 -29
- package/build/__tests__/behavioral/skill/SettingUpASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/stores/CreatingADataStore.test.js +26 -28
- package/build/__tests__/behavioral/stores/CreatingADataStore.test.js.map +1 -1
- package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.js +8 -10
- package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/CreatingATest.test.js +10 -10
- package/build/__tests__/behavioral/tests/CreatingATest.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/RunningTests.test.js +8 -10
- package/build/__tests__/behavioral/tests/RunningTests.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js +17 -17
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SettingUpTests.test.js +3 -5
- package/build/__tests__/behavioral/tests/SettingUpTests.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies.test.js +8 -8
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies2.test.js +7 -7
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies2.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingANodeModule.test.js +6 -6
- package/build/__tests__/behavioral/upgrading/UpgradingANodeModule.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill.test.js +15 -15
- package/build/__tests__/behavioral/upgrading/UpgradingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill2.test.js +24 -24
- package/build/__tests__/behavioral/upgrading/UpgradingASkill2.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill3.test.js +22 -22
- package/build/__tests__/behavioral/upgrading/UpgradingASkill3.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill4.test.js +10 -10
- package/build/__tests__/behavioral/upgrading/UpgradingASkill4.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill5.test.js +9 -9
- package/build/__tests__/behavioral/upgrading/UpgradingASkill5.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingWithListeners.test.js +4 -4
- package/build/__tests__/behavioral/upgrading/UpgradingWithListeners.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingWithSandboxFeatureInstalled.test.js +9 -9
- package/build/__tests__/behavioral/upgrading/UpgradingWithSandboxFeatureInstalled.test.js.map +1 -1
- package/build/__tests__/behavioral/views/CreatingASkillView.test.js +28 -30
- package/build/__tests__/behavioral/views/CreatingASkillView.test.js.map +1 -1
- package/build/__tests__/behavioral/views/CreatingATheme.test.js +9 -11
- package/build/__tests__/behavioral/views/CreatingATheme.test.js.map +1 -1
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js +8 -8
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/views/SettingUpViews.test.js +5 -5
- package/build/__tests__/behavioral/views/SettingUpViews.test.js.map +1 -1
- package/build/__tests__/behavioral/views/TestingViewControllers.test.js +12 -12
- package/build/__tests__/behavioral/views/TestingViewControllers.test.js.map +1 -1
- package/build/__tests__/behavioral/watchers/WatchingForChanges.test.js +10 -10
- package/build/__tests__/behavioral/watchers/WatchingForChanges.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter.test.js +5 -5
- package/build/__tests__/implementation/ActionExecuter.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter2.test.js +30 -30
- package/build/__tests__/implementation/ActionExecuter2.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter3.test.js +3 -5
- package/build/__tests__/implementation/ActionExecuter3.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter4.test.js +2 -4
- package/build/__tests__/implementation/ActionExecuter4.test.js.map +1 -1
- package/build/__tests__/implementation/ArgParser.test.d.ts +1 -1
- package/build/__tests__/implementation/ArgParser.test.js +7 -7
- package/build/__tests__/implementation/ArgParser.test.js.map +1 -1
- package/build/__tests__/implementation/BuildService.test.js +4 -4
- package/build/__tests__/implementation/BuildService.test.js.map +1 -1
- package/build/__tests__/implementation/BulkImporting.test.d.ts +1 -1
- package/build/__tests__/implementation/BulkImporting.test.js +20 -22
- package/build/__tests__/implementation/BulkImporting.test.js.map +1 -1
- package/build/__tests__/implementation/CachingImports.test.js +3 -3
- package/build/__tests__/implementation/CachingImports.test.js.map +1 -1
- package/build/__tests__/implementation/CommandOptionBuilder.test.js +12 -12
- package/build/__tests__/implementation/CommandOptionBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/CommanderCommandResultMapper.test.d.ts +1 -1
- package/build/__tests__/implementation/CommanderCommandResultMapper.test.js +13 -13
- package/build/__tests__/implementation/CommanderCommandResultMapper.test.js.map +1 -1
- package/build/__tests__/implementation/DataStoreStore.test.js +16 -18
- package/build/__tests__/implementation/DataStoreStore.test.js.map +1 -1
- package/build/__tests__/implementation/DeletingOrphanedSchemaDefinitions.test.js +6 -6
- package/build/__tests__/implementation/DeletingOrphanedSchemaDefinitions.test.js.map +1 -1
- package/build/__tests__/implementation/EventContractCleanerUtil.test.d.ts +1 -1
- package/build/__tests__/implementation/EventContractCleanerUtil.test.js +7 -7
- package/build/__tests__/implementation/EventContractCleanerUtil.test.js.map +1 -1
- package/build/__tests__/implementation/EventStore.test.js +27 -29
- package/build/__tests__/implementation/EventStore.test.js.map +1 -1
- package/build/__tests__/implementation/EventTemplateItemBuilder.test.js +12 -12
- package/build/__tests__/implementation/EventTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureCommandAttacher.test.js +23 -23
- package/build/__tests__/implementation/FeatureCommandAttacher.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureFixture.test.js +7 -7
- package/build/__tests__/implementation/FeatureFixture.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureInstaller.test.js +8 -8
- package/build/__tests__/implementation/FeatureInstaller.test.js.map +1 -1
- package/build/__tests__/implementation/FeaturesUtil.test.d.ts +1 -1
- package/build/__tests__/implementation/FeaturesUtil.test.js +4 -4
- package/build/__tests__/implementation/FeaturesUtil.test.js.map +1 -1
- package/build/__tests__/implementation/FieldTemplateItemBuilder.test.js +11 -11
- package/build/__tests__/implementation/FieldTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/GlobalEmitter.js +3 -3
- package/build/__tests__/implementation/GlobalEmitter.js.map +1 -1
- package/build/__tests__/implementation/Introspection.test.js +4 -4
- package/build/__tests__/implementation/Introspection.test.js.map +1 -1
- package/build/__tests__/implementation/JestJsonParser.test.d.ts +1 -1
- package/build/__tests__/implementation/JestJsonParser.test.js +31 -31
- package/build/__tests__/implementation/JestJsonParser.test.js.map +1 -1
- package/build/__tests__/implementation/LintService.test.js +3 -3
- package/build/__tests__/implementation/LintService.test.js.map +1 -1
- package/build/__tests__/implementation/ListenerStore.test.js +3 -3
- package/build/__tests__/implementation/ListenerStore.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingScriptLoader.test.js +9 -9
- package/build/__tests__/implementation/OnboardingScriptLoader.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingScriptPlayer.test.js +17 -17
- package/build/__tests__/implementation/OnboardingScriptPlayer.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingStore.test.js +14 -14
- package/build/__tests__/implementation/OnboardingStore.test.js.map +1 -1
- package/build/__tests__/implementation/OrganizationStore.test.js +10 -10
- package/build/__tests__/implementation/OrganizationStore.test.js.map +1 -1
- package/build/__tests__/implementation/ParentTestFinder.test.js +6 -6
- package/build/__tests__/implementation/ParentTestFinder.test.js.map +1 -1
- package/build/__tests__/implementation/PkgService.test.js +8 -8
- package/build/__tests__/implementation/PkgService.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaStore.test.js +30 -32
- package/build/__tests__/implementation/SchemaStore.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaTemplateItemBuilder.test.js +10 -10
- package/build/__tests__/implementation/SchemaTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaValueTypeWriter.test.js +13 -13
- package/build/__tests__/implementation/SchemaValueTypeWriter.test.js.map +1 -1
- package/build/__tests__/implementation/ServiceFactory.test.js +3 -3
- package/build/__tests__/implementation/ServiceFactory.test.js.map +1 -1
- package/build/__tests__/implementation/SettingUpANodeModule.test.js +4 -6
- package/build/__tests__/implementation/SettingUpANodeModule.test.js.map +1 -1
- package/build/__tests__/implementation/SkillStore.test.js +25 -27
- package/build/__tests__/implementation/SkillStore.test.js.map +1 -1
- package/build/__tests__/implementation/StoreFeature.test.js +4 -4
- package/build/__tests__/implementation/StoreFeature.test.js.map +1 -1
- package/build/__tests__/implementation/TestReporter.test.js +5 -5
- package/build/__tests__/implementation/TestReporter.test.js.map +1 -1
- package/build/__tests__/implementation/TestRunner.test.js +23 -25
- package/build/__tests__/implementation/TestRunner.test.js.map +1 -1
- package/build/__tests__/implementation/ValueTypeMapping.test.js +4 -4
- package/build/__tests__/implementation/ValueTypeMapping.test.js.map +1 -1
- package/build/__tests__/implementation/Widgets.test.js +10 -10
- package/build/__tests__/implementation/Widgets.test.js.map +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/AbstractTest.d.ts +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/AbstractTest.ts +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/AbstractTest2.d.ts +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/AbstractTest2.ts +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/deeper/AbstractBananaTest.d.ts +1 -1
- package/build/__tests__/testDirsAndFiles/abstract_tests/deeper/AbstractBananaTest.ts +1 -1
- package/build/features/onboard/templates/ManagingTodos.test.ts.hbs +1 -1
- package/build/features/test/TestLogItemGenerator.js +2 -2
- package/build/features/test/TestLogItemGenerator.js.map +1 -1
- package/build/interfaces/SpyInterface.js +5 -5
- package/build/interfaces/SpyInterface.js.map +1 -1
- package/build/tests/AbstractCliTest.d.ts +1 -1
- package/build/tests/AbstractCliTest.js +11 -11
- package/build/tests/AbstractCliTest.js.map +1 -1
- package/build/tests/AbstractSchemaTest.js +4 -4
- package/build/tests/AbstractSchemaTest.js.map +1 -1
- package/build/tests/utilities/test.utility.js +6 -6
- package/build/tests/utilities/test.utility.js.map +1 -1
- package/build/tests/utilities/uiAssert.utility.js +6 -6
- package/build/tests/utilities/uiAssert.utility.js.map +1 -1
- package/node_modules/@typescript-eslint/parser/package.json +5 -5
- package/node_modules/@typescript-eslint/scope-manager/package.json +5 -5
- package/node_modules/@typescript-eslint/types/package.json +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/package.json +5 -5
- package/node_modules/@typescript-eslint/visitor-keys/package.json +3 -3
- package/package.json +32 -32
- package/src/__tests__/behavioral/AddingADependency.test.ts +1 -1
- package/src/__tests__/behavioral/BlockingCommands.test.ts +1 -1
- package/src/__tests__/behavioral/BootingTheCli.test.ts +1 -1
- package/src/__tests__/behavioral/BootingWithBadFiles.test.ts +1 -1
- package/src/__tests__/behavioral/CreatingAConversationTopic.test.ts +1 -1
- package/src/__tests__/behavioral/CreatingSchemasWithGenerics.test.ts +1 -1
- package/src/__tests__/behavioral/DeployingASkill.test.ts +1 -1
- package/src/__tests__/behavioral/DeployingToSandbox.test.ts +1 -1
- package/src/__tests__/behavioral/EnablingAndDisablingCache.test.ts +1 -1
- package/src/__tests__/behavioral/GettingCliVersion.test.ts +1 -1
- package/src/__tests__/behavioral/InstallingASkillAtAnOrg.test.ts +1 -1
- package/src/__tests__/behavioral/ListeningToCoreEvents.test.ts +1 -1
- package/src/__tests__/behavioral/LoggingInAsASkill.test.ts +1 -1
- package/src/__tests__/behavioral/ManagingDependencies.test.ts +1 -1
- package/src/__tests__/behavioral/OverridingCommandsInPackageJson.test.ts +1 -1
- package/src/__tests__/behavioral/RebuildingASkill.test.ts +1 -1
- package/src/__tests__/behavioral/RegisteringConversationsOnBoot.test.ts +1 -1
- package/src/__tests__/behavioral/RegisteringEventsOnBoot.test.ts +1 -1
- package/src/__tests__/behavioral/RegisteringGlobalEvents.test.ts +1 -1
- package/src/__tests__/behavioral/RegisteringSkillViewOnBoot.test.ts +1 -1
- package/src/__tests__/behavioral/RememberingUpgradeSelections.test.ts +1 -1
- package/src/__tests__/behavioral/SettingLogTransportsInASkill.test.ts +1 -1
- package/src/__tests__/behavioral/SettingRemote.test.ts +1 -1
- package/src/__tests__/behavioral/SettingUpASkillForTesting.test.ts +1 -1
- package/src/__tests__/behavioral/SettingUpSchemasForModuleDistribution.test.ts +1 -1
- package/src/__tests__/behavioral/SettingUpVscode.test.ts +1 -1
- package/src/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.ts +1 -1
- package/src/__tests__/behavioral/TestReporterSettingsRemembered.test.ts +1 -1
- package/src/__tests__/behavioral/TestingAConversation.test.ts +1 -1
- package/src/__tests__/behavioral/TestingDataStores.test.ts +1 -1
- package/src/__tests__/behavioral/WatchingSkillViews.test.ts +1 -1
- package/src/__tests__/behavioral/errors/CreatingANewErrorBuilder.test.ts +1 -1
- package/src/__tests__/behavioral/errors/KeepingErrorClassInSync.test.ts +1 -1
- package/src/__tests__/behavioral/errors/KeepingErrorsInSync.test.ts +1 -1
- package/src/__tests__/behavioral/errors/SettingUpErrors.test.ts +1 -1
- package/src/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.ts +1 -1
- package/src/__tests__/behavioral/events/CreatingAListener.test.ts +1 -1
- package/src/__tests__/behavioral/events/CreatingAnEvent.test.ts +1 -1
- package/src/__tests__/behavioral/events/KeepingEventsInSync.test.ts +1 -1
- package/src/__tests__/behavioral/events/KeepingEventsInSync2.test.ts +1 -1
- package/src/__tests__/behavioral/events/KeepingListenersInSync.test.ts +1 -1
- package/src/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.ts +1 -1
- package/src/__tests__/behavioral/events/SettingUpEvents.test.ts +1 -1
- package/src/__tests__/behavioral/events/SkillEmitsBootEvents.test.ts +1 -1
- package/src/__tests__/behavioral/node/CreatingANodeModule.test.ts +1 -1
- package/src/__tests__/behavioral/onboard/StartingOnboarding.test.ts +1 -1
- package/src/__tests__/behavioral/organization/CreatingAnOrg.test.ts +1 -1
- package/src/__tests__/behavioral/permissions/CreatingPermissions.test.ts +1 -1
- package/src/__tests__/behavioral/person/LoggingInAsPerson.test.ts +1 -1
- package/src/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.ts +1 -1
- package/src/__tests__/behavioral/polish/SettingUpPolish.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/CreatingANewSchemaBuilder.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/GeneratingFieldTypesOnly.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/HandlesRelatedSchemas.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/ImportingSchemaImports.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/KeepingSchemasInSync.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/SettingUpSchemas.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/SyncingBadSchemasProvidesHelpfulErrorMessages.test.ts +1 -1
- package/src/__tests__/behavioral/schemas/UsingSchemasInCli.test.ts +1 -1
- package/src/__tests__/behavioral/skill/BootingASkill.test.ts +1 -1
- package/src/__tests__/behavioral/skill/CreatingASkill.test.ts +1 -1
- package/src/__tests__/behavioral/skill/RegisteringASkill.test.ts +1 -1
- package/src/__tests__/behavioral/skill/SettingUpASkill.test.ts +1 -1
- package/src/__tests__/behavioral/stores/CreatingADataStore.test.ts +1 -1
- package/src/__tests__/behavioral/stores/KeepingDataStoresInSync.test.ts +1 -1
- package/src/__tests__/behavioral/tests/CreatingATest.test.ts +1 -1
- package/src/__tests__/behavioral/tests/RunningTests.test.ts +1 -1
- package/src/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.ts +1 -1
- package/src/__tests__/behavioral/tests/SettingUpTests.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpdatingDependencies.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpdatingDependencies2.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingANodeModule.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingASkill.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingASkill2.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingASkill3.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingASkill4.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingASkill5.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingWithListeners.test.ts +1 -1
- package/src/__tests__/behavioral/upgrading/UpgradingWithSandboxFeatureInstalled.test.ts +1 -1
- package/src/__tests__/behavioral/views/CreatingASkillView.test.ts +1 -1
- package/src/__tests__/behavioral/views/CreatingATheme.test.ts +1 -1
- package/src/__tests__/behavioral/views/KeepingViewsInSync.test.ts +1 -1
- package/src/__tests__/behavioral/views/SettingUpViews.test.ts +1 -1
- package/src/__tests__/behavioral/views/TestingViewControllers.test.ts +1 -1
- package/src/__tests__/behavioral/watchers/WatchingForChanges.test.ts +1 -1
- package/src/__tests__/implementation/ActionExecuter.test.ts +1 -1
- package/src/__tests__/implementation/ActionExecuter2.test.ts +1 -1
- package/src/__tests__/implementation/ActionExecuter3.test.ts +1 -1
- package/src/__tests__/implementation/ActionExecuter4.test.ts +1 -1
- package/src/__tests__/implementation/ArgParser.test.ts +1 -1
- package/src/__tests__/implementation/BuildService.test.ts +1 -1
- package/src/__tests__/implementation/BulkImporting.test.ts +1 -1
- package/src/__tests__/implementation/CachingImports.test.ts +1 -1
- package/src/__tests__/implementation/CommandOptionBuilder.test.ts +1 -1
- package/src/__tests__/implementation/CommanderCommandResultMapper.test.ts +1 -1
- package/src/__tests__/implementation/DataStoreStore.test.ts +1 -1
- package/src/__tests__/implementation/DeletingOrphanedSchemaDefinitions.test.ts +1 -1
- package/src/__tests__/implementation/EventContractCleanerUtil.test.ts +1 -1
- package/src/__tests__/implementation/EventStore.test.ts +1 -1
- package/src/__tests__/implementation/EventTemplateItemBuilder.test.ts +1 -1
- package/src/__tests__/implementation/FeatureCommandAttacher.test.ts +1 -1
- package/src/__tests__/implementation/FeatureFixture.test.ts +1 -1
- package/src/__tests__/implementation/FeatureInstaller.test.ts +1 -1
- package/src/__tests__/implementation/FeaturesUtil.test.ts +1 -1
- package/src/__tests__/implementation/FieldTemplateItemBuilder.test.ts +1 -1
- package/src/__tests__/implementation/GlobalEmitter.ts +1 -1
- package/src/__tests__/implementation/Introspection.test.ts +1 -1
- package/src/__tests__/implementation/JestJsonParser.test.ts +1 -1
- package/src/__tests__/implementation/LintService.test.ts +1 -1
- package/src/__tests__/implementation/ListenerStore.test.ts +1 -1
- package/src/__tests__/implementation/OnboardingScriptLoader.test.ts +1 -1
- package/src/__tests__/implementation/OnboardingScriptPlayer.test.ts +1 -1
- package/src/__tests__/implementation/OnboardingStore.test.ts +1 -1
- package/src/__tests__/implementation/OrganizationStore.test.ts +1 -1
- package/src/__tests__/implementation/ParentTestFinder.test.ts +1 -1
- package/src/__tests__/implementation/PkgService.test.ts +1 -1
- package/src/__tests__/implementation/SchemaStore.test.ts +1 -1
- package/src/__tests__/implementation/SchemaTemplateItemBuilder.test.ts +1 -1
- package/src/__tests__/implementation/SchemaValueTypeWriter.test.ts +1 -1
- package/src/__tests__/implementation/ServiceFactory.test.ts +1 -1
- package/src/__tests__/implementation/SettingUpANodeModule.test.ts +1 -1
- package/src/__tests__/implementation/SkillStore.test.ts +1 -1
- package/src/__tests__/implementation/StoreFeature.test.ts +1 -1
- package/src/__tests__/implementation/TestReporter.test.ts +1 -1
- package/src/__tests__/implementation/TestRunner.test.ts +1 -1
- package/src/__tests__/implementation/ValueTypeMapping.test.ts +1 -1
- package/src/__tests__/implementation/Widgets.test.ts +1 -1
- package/src/__tests__/testDirsAndFiles/abstract_tests/AbstractTest.ts +1 -1
- package/src/__tests__/testDirsAndFiles/abstract_tests/AbstractTest2.ts +1 -1
- package/src/__tests__/testDirsAndFiles/abstract_tests/deeper/AbstractBananaTest.ts +1 -1
- package/src/features/onboard/templates/ManagingTodos.test.ts.hbs +1 -1
- package/src/features/test/TestLogItemGenerator.ts +1 -1
- package/src/interfaces/SpyInterface.ts +1 -1
- package/src/tests/AbstractCliTest.ts +1 -1
- package/src/tests/AbstractSchemaTest.ts +1 -1
- package/src/tests/utilities/test.utility.ts +1 -1
- package/src/tests/utilities/uiAssert.utility.ts +1 -1
|
@@ -27,8 +27,6 @@ var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/
|
|
|
27
27
|
|
|
28
28
|
var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
|
|
29
29
|
|
|
30
|
-
var _test = require("@sprucelabs/test");
|
|
31
|
-
|
|
32
30
|
var _testUtils = require("@sprucelabs/test-utils");
|
|
33
31
|
|
|
34
32
|
require("@sprucelabs/spruce-store-plugin");
|
|
@@ -37,7 +35,7 @@ var _CommandService = _interopRequireDefault(require("../../../services/CommandS
|
|
|
37
35
|
|
|
38
36
|
var _AbstractSkillTest2 = _interopRequireDefault(require("../../../tests/AbstractSkillTest"));
|
|
39
37
|
|
|
40
|
-
var
|
|
38
|
+
var _test = _interopRequireDefault(require("../../../tests/utilities/test.utility"));
|
|
41
39
|
|
|
42
40
|
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _class, _class2;
|
|
43
41
|
|
|
@@ -45,7 +43,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
45
43
|
|
|
46
44
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
45
|
|
|
48
|
-
var CreatingDataStoresTest = (_dec = (0,
|
|
46
|
+
var CreatingDataStoresTest = (_dec = (0, _testUtils.test)(), _dec2 = (0, _testUtils.test)(), _dec3 = (0, _testUtils.test)(), _dec4 = (0, _testUtils.test)(), _dec5 = (0, _testUtils.test)(), _dec6 = (0, _testUtils.test)(), _dec7 = (0, _testUtils.test)(), _dec8 = (0, _testUtils.test)(), _dec9 = (0, _testUtils.test)(), _dec10 = (0, _testUtils.test)(), _dec11 = (0, _testUtils.test)(), (_class = (_class2 = /*#__PURE__*/function (_AbstractSkillTest) {
|
|
49
47
|
(0, _inherits2["default"])(CreatingDataStoresTest, _AbstractSkillTest);
|
|
50
48
|
|
|
51
49
|
var _super = _createSuper(CreatingDataStoresTest);
|
|
@@ -63,7 +61,7 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
63
61
|
while (1) {
|
|
64
62
|
switch (_context.prev = _context.next) {
|
|
65
63
|
case 0:
|
|
66
|
-
|
|
64
|
+
_testUtils.assert.isFunction(this.Action('store', 'create').execute);
|
|
67
65
|
|
|
68
66
|
case 1:
|
|
69
67
|
case "end":
|
|
@@ -96,19 +94,19 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
96
94
|
case 2:
|
|
97
95
|
health = _context2.sent;
|
|
98
96
|
|
|
99
|
-
|
|
97
|
+
_testUtils.assert.isFalsy(health.skill.errors); //@ts-ignore
|
|
100
98
|
|
|
101
99
|
|
|
102
|
-
|
|
100
|
+
_testUtils.assert.isTruthy(health.store); //@ts-ignore
|
|
103
101
|
|
|
104
102
|
|
|
105
|
-
|
|
103
|
+
_testUtils.assert.isFalsy(health.store.errors); //@ts-ignore
|
|
106
104
|
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
_testUtils.assert.isArray(health.store.stores); //@ts-ignore
|
|
109
107
|
|
|
110
108
|
|
|
111
|
-
|
|
109
|
+
_testUtils.assert.isLength(health.store.stores, 0);
|
|
112
110
|
|
|
113
111
|
case 8:
|
|
114
112
|
case "end":
|
|
@@ -143,9 +141,9 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
143
141
|
case 2:
|
|
144
142
|
results = _context3.sent;
|
|
145
143
|
|
|
146
|
-
|
|
144
|
+
_testUtils.assert.isFalsy(results.errors);
|
|
147
145
|
|
|
148
|
-
path =
|
|
146
|
+
path = _test["default"].assertFileByNameInGeneratedFiles('People.store.ts', results.files);
|
|
149
147
|
_context3.next = 7;
|
|
150
148
|
return this.Service('typeChecker').check(path);
|
|
151
149
|
|
|
@@ -174,7 +172,7 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
174
172
|
case 0:
|
|
175
173
|
file = this.resolveHashSprucePath('stores', 'stores.ts');
|
|
176
174
|
|
|
177
|
-
|
|
175
|
+
_testUtils.assert.isTrue(_spruceSkillUtils.diskUtil.doesFileExist(file));
|
|
178
176
|
|
|
179
177
|
_context4.next = 4;
|
|
180
178
|
return this.Service('typeChecker').check(file);
|
|
@@ -211,16 +209,16 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
211
209
|
health = _context5.sent;
|
|
212
210
|
|
|
213
211
|
//@ts-ignore
|
|
214
|
-
|
|
212
|
+
_testUtils.assert.isTruthy(health.store); //@ts-ignore
|
|
215
213
|
|
|
216
214
|
|
|
217
|
-
|
|
215
|
+
_testUtils.assert.isFalsy(health.store.errors); //@ts-ignore
|
|
218
216
|
|
|
219
217
|
|
|
220
|
-
|
|
218
|
+
_testUtils.assert.isLength(health.store.stores, 1); //@ts-ignore
|
|
221
219
|
|
|
222
220
|
|
|
223
|
-
|
|
221
|
+
_testUtils.assert.isEqual(health.store.stores[0].name, 'People');
|
|
224
222
|
|
|
225
223
|
case 7:
|
|
226
224
|
case "end":
|
|
@@ -255,9 +253,9 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
255
253
|
case 2:
|
|
256
254
|
results = _context6.sent;
|
|
257
255
|
|
|
258
|
-
|
|
256
|
+
_testUtils.assert.isFalsy(results.errors);
|
|
259
257
|
|
|
260
|
-
path =
|
|
258
|
+
path = _test["default"].assertFileByNameInGeneratedFiles('Bids.store.ts', results.files);
|
|
261
259
|
_context6.next = 7;
|
|
262
260
|
return this.Service('typeChecker').check(path);
|
|
263
261
|
|
|
@@ -293,19 +291,19 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
293
291
|
health = _context7.sent;
|
|
294
292
|
|
|
295
293
|
//@ts-ignore
|
|
296
|
-
|
|
294
|
+
_testUtils.assert.isTruthy(health.store); //@ts-ignore
|
|
297
295
|
|
|
298
296
|
|
|
299
|
-
|
|
297
|
+
_testUtils.assert.isFalsy(health.store.errors); //@ts-ignore
|
|
300
298
|
|
|
301
299
|
|
|
302
|
-
|
|
300
|
+
_testUtils.assert.isLength(health.store.stores, 2); //@ts-ignore
|
|
303
301
|
|
|
304
302
|
|
|
305
|
-
|
|
303
|
+
_testUtils.assert.isEqual(health.store.stores[0].name, 'Bids'); //@ts-ignore
|
|
306
304
|
|
|
307
305
|
|
|
308
|
-
|
|
306
|
+
_testUtils.assert.isEqual(health.store.stores[1].name, 'People');
|
|
309
307
|
|
|
310
308
|
case 8:
|
|
311
309
|
case "end":
|
|
@@ -340,7 +338,7 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
340
338
|
case 2:
|
|
341
339
|
results = _context8.sent;
|
|
342
340
|
|
|
343
|
-
|
|
341
|
+
_testUtils.assert.isTruthy(results.errors);
|
|
344
342
|
|
|
345
343
|
_testUtils.errorAssert.assertError(results.errors[0], 'STORE_EXISTS');
|
|
346
344
|
|
|
@@ -376,7 +374,7 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
376
374
|
|
|
377
375
|
case 2:
|
|
378
376
|
results = _context9.sent;
|
|
379
|
-
path =
|
|
377
|
+
path = _test["default"].assertFileByNameInGeneratedFiles('Products.store.ts', results.files);
|
|
380
378
|
storeContents = _spruceSkillUtils.diskUtil.readFile(path).replace('type ProductsStoreOptions = UniversalStoreOptions', 'type ProductsStoreOptions = UniversalStoreOptions & {hello: string}');
|
|
381
379
|
|
|
382
380
|
_spruceSkillUtils.diskUtil.writeFile(path, storeContents);
|
|
@@ -412,7 +410,7 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
412
410
|
while (1) {
|
|
413
411
|
switch (_context10.prev = _context10.next) {
|
|
414
412
|
case 0:
|
|
415
|
-
|
|
413
|
+
_testUtils.assert.isFalse(_spruceSkillUtils.diskUtil.doesFileExist(CreatingDataStoresTest.getAbstractTestPath()));
|
|
416
414
|
|
|
417
415
|
case 1:
|
|
418
416
|
case "end":
|
|
@@ -453,7 +451,7 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
453
451
|
return this.Action('node', 'upgrade').execute({});
|
|
454
452
|
|
|
455
453
|
case 6:
|
|
456
|
-
|
|
454
|
+
_testUtils.assert.isTrue(_spruceSkillUtils.diskUtil.doesFileExist(storesFile));
|
|
457
455
|
|
|
458
456
|
case 7:
|
|
459
457
|
case "end":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatingADataStore.test.js","names":["CreatingDataStoresTest","test","assert","isFunction","Action","execute","cli","checkHealth","shouldRunOnSourceFiles","health","isFalsy","skill","errors","isTruthy","store","isArray","stores","isLength","nameReadable","nameReadablePlural","namePascal","results","path","testUtil","assertFileByNameInGeneratedFiles","files","Service","check","file","resolveHashSprucePath","isTrue","diskUtil","doesFileExist","isEqual","name","errorAssert","assertError","storeContents","readFile","replace","writeFile","testFile","resolveTestPath","testContents","dest","resolvePath","isFalse","getAbstractTestPath","CommandService","fakeCommand","code","storesFile","deleteFile","AbstractSkillTest"],"sources":["../../../../src/__tests__/behavioral/stores/CreatingADataStore.test.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport { errorAssert } from '@sprucelabs/test-utils'\nimport '@sprucelabs/spruce-store-plugin'\nimport CommandService from '../../../services/CommandService'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class CreatingDataStoresTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'stores'\n\n\t@test()\n\tprotected static async hasCreateStoreAction() {\n\t\tassert.isFunction(this.Action('store', 'create').execute)\n\t}\n\n\t@test()\n\tprotected static async getsNoStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\n\t\tassert.isFalsy(health.skill.errors)\n\t\t//@ts-ignore\n\t\tassert.isTruthy(health.store)\n\t\t//@ts-ignore\n\t\tassert.isFalsy(health.store.errors)\n\t\t//@ts-ignore\n\t\tassert.isArray(health.store.stores)\n\t\t//@ts-ignore\n\t\tassert.isLength(health.store.stores, 0)\n\t}\n\n\t@test()\n\tprotected static async generatesValidStoreFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Person',\n\t\t\tnameReadablePlural: 'People',\n\t\t\tnamePascal: 'Person',\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'People.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait this.Service('typeChecker').check(path)\n\t}\n\n\t@test()\n\tprotected static async generatesAMapFile() {\n\t\tconst file = this.resolveHashSprucePath('stores', 'stores.ts')\n\t\tassert.isTrue(diskUtil.doesFileExist(file))\n\t\tawait this.Service('typeChecker').check(file)\n\t}\n\n\t@test()\n\tprotected static async getsOneStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\t\t//@ts-ignore\n\t\tassert.isTruthy(health.store)\n\t\t//@ts-ignore\n\t\tassert.isFalsy(health.store.errors)\n\t\t//@ts-ignore\n\t\tassert.isLength(health.store.stores, 1)\n\t\t//@ts-ignore\n\t\tassert.isEqual(health.store.stores[0].name, 'People')\n\t}\n\n\t@test()\n\tprotected static async canGenerateASecondStoreFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'Bids.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait this.Service('typeChecker').check(path)\n\t}\n\n\t@test()\n\tprotected static async getsSecondStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\n\t\t//@ts-ignore\n\t\tassert.isTruthy(health.store)\n\t\t//@ts-ignore\n\t\tassert.isFalsy(health.store.errors)\n\t\t//@ts-ignore\n\t\tassert.isLength(health.store.stores, 2)\n\t\t//@ts-ignore\n\t\tassert.isEqual(health.store.stores[0].name, 'Bids')\n\t\t//@ts-ignore\n\t\tassert.isEqual(health.store.stores[1].name, 'People')\n\t}\n\n\t@test()\n\tprotected static async errorsWhenGeneratingAStoreWithTheSameName() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tassert.isTruthy(results.errors)\n\t\terrorAssert.assertError(results.errors[0], 'STORE_EXISTS')\n\t}\n\n\t@test()\n\tprotected static async storeFactoryAndStoresAreTyped() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Product',\n\t\t\tnameReadablePlural: 'Products',\n\t\t\tnamePascal: 'Product',\n\t\t})\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'Products.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst storeContents = diskUtil\n\t\t\t.readFile(path)\n\t\t\t.replace(\n\t\t\t\t'type ProductsStoreOptions = UniversalStoreOptions',\n\t\t\t\t'type ProductsStoreOptions = UniversalStoreOptions & {hello: string}'\n\t\t\t)\n\n\t\tdiskUtil.writeFile(path, storeContents)\n\n\t\tconst testFile = this.resolveTestPath('store-test.ts.hbs')\n\t\tconst testContents = diskUtil.readFile(testFile)\n\n\t\tconst dest = this.resolvePath('src', 'test.ts')\n\t\tdiskUtil.writeFile(dest, testContents)\n\n\t\tawait this.Service('typeChecker').check(dest)\n\t}\n\n\t@test()\n\tprotected static async doesNotCreateAbstractTestFileBecauseTestIsNotInstalled() {\n\t\tassert.isFalse(\n\t\t\tdiskUtil.doesFileExist(CreatingDataStoresTest.getAbstractTestPath())\n\t\t)\n\t}\n\n\t@test()\n\tprotected static async upgradeRestoresDataStoreTypes() {\n\t\tCommandService.fakeCommand('yarn rebuild', {\n\t\t\tcode: 0,\n\t\t})\n\n\t\tCommandService.fakeCommand(/yarn add/gis, {\n\t\t\tcode: 0,\n\t\t})\n\n\t\tconst storesFile = this.resolveHashSprucePath('stores/stores.types.ts')\n\t\tdiskUtil.deleteFile(storesFile)\n\t\tawait this.Action('node', 'upgrade').execute({})\n\t\tassert.isTrue(diskUtil.doesFileExist(storesFile))\n\t}\n\n\tprivate static getAbstractTestPath(): string {\n\t\treturn this.resolvePath('src', 'tests', 'AbstractDataStoreTest.ts')\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,sB,WAGnB,IAAAC,UAAA,G,UAKA,IAAAA,UAAA,G,UAeA,IAAAA,UAAA,G,UAkBA,IAAAA,UAAA,G,UAOA,IAAAA,UAAA,G,UAaA,IAAAA,UAAA,G,UAkBA,IAAAA,UAAA,G,UAgBA,IAAAA,UAAA,G,UAYA,IAAAA,UAAA,G,WA+BA,IAAAA,UAAA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AA;gBAEC1C,YAAA,CAAO4C,OAAP,CACCf,0BAAA,CAASC,aAAT,CAAuBhC,sBAAsB,CAAC+C,mBAAvB,EAAvB,CADD;;cAFD;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;yHAOA;QAAA;QAAA;UAAA;YAAA;cAAA;gBAECC,0BAAA,CAAeC,WAAf,CAA2B,cAA3B,EAA2C;kBAC1CC,IAAI,EAAE;gBADoC,CAA3C;;gBAIAF,0BAAA,CAAeC,WAAf,CAA2B,YAA3B,EAA0C;kBACzCC,IAAI,EAAE;gBADmC,CAA1C;;gBAIMC,UAVP,GAUoB,KAAKtB,qBAAL,CAA2B,wBAA3B,CAVpB;;gBAWCE,0BAAA,CAASqB,UAAT,CAAoBD,UAApB;;gBAXD;gBAAA,OAYO,KAAK/C,MAAL,CAAY,MAAZ,EAAoB,SAApB,EAA+BC,OAA/B,CAAuC,EAAvC,CAZP;;cAAA;gBAaCH,YAAA,CAAO4B,MAAP,CAAcC,0BAAA,CAASC,aAAT,CAAuBmB,UAAvB,CAAd;;cAbD;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;WAgBA,+BAA6C;MAC5C,OAAO,KAAKN,WAAL,CAAiB,KAAjB,EAAwB,OAAxB,EAAiC,0BAAjC,CAAP;IACA;;;EAnKkDQ,8B,8DAClB,Q"}
|
|
1
|
+
{"version":3,"file":"CreatingADataStore.test.js","names":["CreatingDataStoresTest","test","assert","isFunction","Action","execute","cli","checkHealth","shouldRunOnSourceFiles","health","isFalsy","skill","errors","isTruthy","store","isArray","stores","isLength","nameReadable","nameReadablePlural","namePascal","results","path","testUtil","assertFileByNameInGeneratedFiles","files","Service","check","file","resolveHashSprucePath","isTrue","diskUtil","doesFileExist","isEqual","name","errorAssert","assertError","storeContents","readFile","replace","writeFile","testFile","resolveTestPath","testContents","dest","resolvePath","isFalse","getAbstractTestPath","CommandService","fakeCommand","code","storesFile","deleteFile","AbstractSkillTest"],"sources":["../../../../src/__tests__/behavioral/stores/CreatingADataStore.test.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test-utils'\nimport { errorAssert } from '@sprucelabs/test-utils'\nimport '@sprucelabs/spruce-store-plugin'\nimport CommandService from '../../../services/CommandService'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class CreatingDataStoresTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'stores'\n\n\t@test()\n\tprotected static async hasCreateStoreAction() {\n\t\tassert.isFunction(this.Action('store', 'create').execute)\n\t}\n\n\t@test()\n\tprotected static async getsNoStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\n\t\tassert.isFalsy(health.skill.errors)\n\t\t//@ts-ignore\n\t\tassert.isTruthy(health.store)\n\t\t//@ts-ignore\n\t\tassert.isFalsy(health.store.errors)\n\t\t//@ts-ignore\n\t\tassert.isArray(health.store.stores)\n\t\t//@ts-ignore\n\t\tassert.isLength(health.store.stores, 0)\n\t}\n\n\t@test()\n\tprotected static async generatesValidStoreFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Person',\n\t\t\tnameReadablePlural: 'People',\n\t\t\tnamePascal: 'Person',\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'People.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait this.Service('typeChecker').check(path)\n\t}\n\n\t@test()\n\tprotected static async generatesAMapFile() {\n\t\tconst file = this.resolveHashSprucePath('stores', 'stores.ts')\n\t\tassert.isTrue(diskUtil.doesFileExist(file))\n\t\tawait this.Service('typeChecker').check(file)\n\t}\n\n\t@test()\n\tprotected static async getsOneStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\t\t//@ts-ignore\n\t\tassert.isTruthy(health.store)\n\t\t//@ts-ignore\n\t\tassert.isFalsy(health.store.errors)\n\t\t//@ts-ignore\n\t\tassert.isLength(health.store.stores, 1)\n\t\t//@ts-ignore\n\t\tassert.isEqual(health.store.stores[0].name, 'People')\n\t}\n\n\t@test()\n\tprotected static async canGenerateASecondStoreFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'Bids.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait this.Service('typeChecker').check(path)\n\t}\n\n\t@test()\n\tprotected static async getsSecondStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\n\t\t//@ts-ignore\n\t\tassert.isTruthy(health.store)\n\t\t//@ts-ignore\n\t\tassert.isFalsy(health.store.errors)\n\t\t//@ts-ignore\n\t\tassert.isLength(health.store.stores, 2)\n\t\t//@ts-ignore\n\t\tassert.isEqual(health.store.stores[0].name, 'Bids')\n\t\t//@ts-ignore\n\t\tassert.isEqual(health.store.stores[1].name, 'People')\n\t}\n\n\t@test()\n\tprotected static async errorsWhenGeneratingAStoreWithTheSameName() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tassert.isTruthy(results.errors)\n\t\terrorAssert.assertError(results.errors[0], 'STORE_EXISTS')\n\t}\n\n\t@test()\n\tprotected static async storeFactoryAndStoresAreTyped() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Product',\n\t\t\tnameReadablePlural: 'Products',\n\t\t\tnamePascal: 'Product',\n\t\t})\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'Products.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst storeContents = diskUtil\n\t\t\t.readFile(path)\n\t\t\t.replace(\n\t\t\t\t'type ProductsStoreOptions = UniversalStoreOptions',\n\t\t\t\t'type ProductsStoreOptions = UniversalStoreOptions & {hello: string}'\n\t\t\t)\n\n\t\tdiskUtil.writeFile(path, storeContents)\n\n\t\tconst testFile = this.resolveTestPath('store-test.ts.hbs')\n\t\tconst testContents = diskUtil.readFile(testFile)\n\n\t\tconst dest = this.resolvePath('src', 'test.ts')\n\t\tdiskUtil.writeFile(dest, testContents)\n\n\t\tawait this.Service('typeChecker').check(dest)\n\t}\n\n\t@test()\n\tprotected static async doesNotCreateAbstractTestFileBecauseTestIsNotInstalled() {\n\t\tassert.isFalse(\n\t\t\tdiskUtil.doesFileExist(CreatingDataStoresTest.getAbstractTestPath())\n\t\t)\n\t}\n\n\t@test()\n\tprotected static async upgradeRestoresDataStoreTypes() {\n\t\tCommandService.fakeCommand('yarn rebuild', {\n\t\t\tcode: 0,\n\t\t})\n\n\t\tCommandService.fakeCommand(/yarn add/gis, {\n\t\t\tcode: 0,\n\t\t})\n\n\t\tconst storesFile = this.resolveHashSprucePath('stores/stores.types.ts')\n\t\tdiskUtil.deleteFile(storesFile)\n\t\tawait this.Action('node', 'upgrade').execute({})\n\t\tassert.isTrue(diskUtil.doesFileExist(storesFile))\n\t}\n\n\tprivate static getAbstractTestPath(): string {\n\t\treturn this.resolvePath('src', 'tests', 'AbstractDataStoreTest.ts')\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,sB,WAGnB,IAAAC,eAAA,G,UAKA,IAAAA,eAAA,G,UAeA,IAAAA,eAAA,G,UAkBA,IAAAA,eAAA,G,UAOA,IAAAA,eAAA,G,UAaA,IAAAA,eAAA,G,UAkBA,IAAAA,eAAA,G,UAg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A;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;kJA+BA;QAAA;UAAA;YAAA;cAAA;gBAEC1C,iBAAA,CAAO4C,OAAP,CACCf,0BAAA,CAASC,aAAT,CAAuBhC,sBAAsB,CAAC+C,mBAAvB,EAAvB,CADD;;cAFD;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;yHAOA;QAAA;QAAA;UAAA;YAAA;cAAA;gBAECC,0BAAA,CAAeC,WAAf,CAA2B,cAA3B,EAA2C;kBAC1CC,IAAI,EAAE;gBADoC,CAA3C;;gBAIAF,0BAAA,CAAeC,WAAf,CAA2B,YAA3B,EAA0C;kBACzCC,IAAI,EAAE;gBADmC,CAA1C;;gBAIMC,UAVP,GAUoB,KAAKtB,qBAAL,CAA2B,wBAA3B,CAVpB;;gBAWCE,0BAAA,CAASqB,UAAT,CAAoBD,UAApB;;gBAXD;gBAAA,OAYO,KAAK/C,MAAL,CAAY,MAAZ,EAAoB,SAApB,EAA+BC,OAA/B,CAAuC,EAAvC,CAZP;;cAAA;gBAaCH,iBAAA,CAAO4B,MAAP,CAAcC,0BAAA,CAASC,aAAT,CAAuBmB,UAAvB,CAAd;;cAbD;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;WAgBA,+BAA6C;MAC5C,OAAO,KAAKN,WAAL,CAAiB,KAAjB,EAAwB,OAAxB,EAAiC,0BAAjC,CAAP;IACA;;;EAnKkDQ,8B,8DAClB,Q"}
|
|
@@ -29,13 +29,11 @@ var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/
|
|
|
29
29
|
|
|
30
30
|
var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
|
|
31
31
|
|
|
32
|
-
var _test = require("@sprucelabs/test");
|
|
33
|
-
|
|
34
32
|
var _testUtils = require("@sprucelabs/test-utils");
|
|
35
33
|
|
|
36
34
|
var _AbstractSkillTest2 = _interopRequireDefault(require("../../../tests/AbstractSkillTest"));
|
|
37
35
|
|
|
38
|
-
var
|
|
36
|
+
var _test = _interopRequireDefault(require("../../../tests/utilities/test.utility"));
|
|
39
37
|
|
|
40
38
|
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2;
|
|
41
39
|
|
|
@@ -43,7 +41,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
43
41
|
|
|
44
42
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
43
|
|
|
46
|
-
var KeepingDataStoresInSyncTest = (_dec = (0,
|
|
44
|
+
var KeepingDataStoresInSyncTest = (_dec = (0, _testUtils.test)(), _dec2 = (0, _testUtils.test)(), _dec3 = (0, _testUtils.test)(), _dec4 = (0, _testUtils.test)(), _dec5 = (0, _testUtils.test)(), _dec6 = (0, _testUtils.test)(), (_class = (_class2 = /*#__PURE__*/function (_AbstractSkillTest) {
|
|
47
45
|
(0, _inherits2["default"])(KeepingDataStoresInSyncTest, _AbstractSkillTest);
|
|
48
46
|
|
|
49
47
|
var _super = _createSuper(KeepingDataStoresInSyncTest);
|
|
@@ -117,7 +115,7 @@ var KeepingDataStoresInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
|
|
|
117
115
|
while (1) {
|
|
118
116
|
switch (_context3.prev = _context3.next) {
|
|
119
117
|
case 0:
|
|
120
|
-
|
|
118
|
+
_testUtils.assert.isFunction(this.Action('store', 'sync').execute);
|
|
121
119
|
|
|
122
120
|
case 1:
|
|
123
121
|
case "end":
|
|
@@ -148,7 +146,7 @@ var KeepingDataStoresInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
|
|
|
148
146
|
case 2:
|
|
149
147
|
results = _context4.sent;
|
|
150
148
|
|
|
151
|
-
|
|
149
|
+
_testUtils.assert.isLength(results.files, 0);
|
|
152
150
|
|
|
153
151
|
case 4:
|
|
154
152
|
case "end":
|
|
@@ -181,9 +179,9 @@ var KeepingDataStoresInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
|
|
|
181
179
|
case 3:
|
|
182
180
|
results = _context5.sent;
|
|
183
181
|
|
|
184
|
-
|
|
182
|
+
_testUtils.assert.isArray(results.errors);
|
|
185
183
|
|
|
186
|
-
|
|
184
|
+
_testUtils.assert.isLength(results.errors, 1);
|
|
187
185
|
|
|
188
186
|
_testUtils.errorAssert.assertError(results.errors[0], 'FAILED_TO_IMPORT', {
|
|
189
187
|
file: 'Bad.store.ts'
|
|
@@ -313,8 +311,8 @@ var KeepingDataStoresInSyncTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
|
|
|
313
311
|
while (1) {
|
|
314
312
|
switch (_context9.prev = _context9.next) {
|
|
315
313
|
case 0:
|
|
316
|
-
typesFile =
|
|
317
|
-
mapFile =
|
|
314
|
+
typesFile = _test["default"].assertFileByNameInGeneratedFiles('stores.types.ts', results.files);
|
|
315
|
+
mapFile = _test["default"].assertFileByNameInGeneratedFiles('stores.ts', results.files);
|
|
318
316
|
_context9.next = 4;
|
|
319
317
|
return Promise.all([this.Service('typeChecker').check(typesFile), this.Service('typeChecker').check(mapFile)]);
|
|
320
318
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeepingDataStoresInSync.test.js","names":["KeepingDataStoresInSyncTest","test","badStoreDest","resolvePath","diskUtil","deleteFile","assert","isFunction","Action","execute","syncStores","results","isLength","files","writeFile","isArray","errors","errorAssert","assertError","file","nameReadable","nameReadablePlural","namePascal","validateFiles","typesFile","testUtil","assertFileByNameInGeneratedFiles","mapFile","Promise","all","Service","check","AbstractSkillTest"],"sources":["../../../../src/__tests__/behavioral/stores/KeepingDataStoresInSync.test.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport { errorAssert } from '@sprucelabs/test-utils'\nimport { FeatureActionResponse } from '../../../features/features.types'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class KeepingDataStoresInSyncTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'stores'\n\tprotected static badStoreDest: string\n\tprotected static async beforeAll() {\n\t\tawait super.beforeAll()\n\t\tthis.badStoreDest = this.resolvePath('src/stores/Bad.store.ts')\n\t}\n\n\tprotected static async beforeEach() {\n\t\tawait super.beforeEach()\n\t\tdiskUtil.deleteFile(this.badStoreDest)\n\t}\n\n\t@test()\n\tprotected static async hasSyncAction() {\n\t\tassert.isFunction(this.Action('store', 'sync').execute)\n\t}\n\n\t@test()\n\tprotected static async syncsNothingToStart() {\n\t\tconst results = await this.syncStores()\n\n\t\tassert.isLength(results.files, 0)\n\t}\n\n\t@test()\n\tprotected static async badFileReturnsError() {\n\t\tdiskUtil.writeFile(this.badStoreDest, 'throw new Error(\"Cheese!\")')\n\n\t\tconst results = await this.syncStores()\n\t\tassert.isArray(results.errors)\n\t\tassert.isLength(results.errors, 1)\n\n\t\terrorAssert.assertError(results.errors[0], 'FAILED_TO_IMPORT', {\n\t\t\tfile: 'Bad.store.ts',\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async generatesValidTypeFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tawait this.validateFiles(results)\n\t}\n\n\t@test()\n\tprotected static async fileIsValidAfterSync() {\n\t\tconst results = await this.syncStores()\n\n\t\tawait this.validateFiles(results)\n\t}\n\n\t@test()\n\tprotected static async canAddSecondStore() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Person',\n\t\t\tnameReadablePlural: 'People',\n\t\t\tnamePascal: 'Person',\n\t\t})\n\n\t\tawait this.validateFiles(results)\n\t}\n\n\tprivate static async validateFiles(results: FeatureActionResponse) {\n\t\tconst typesFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'stores.types.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst mapFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'stores.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait Promise.all([\n\t\t\tthis.Service('typeChecker').check(typesFile),\n\t\t\tthis.Service('typeChecker').check(mapFile),\n\t\t])\n\t}\n\n\tprivate static async syncStores() {\n\t\treturn this.Action('store', 'sync').execute({})\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;
|
|
1
|
+
{"version":3,"file":"KeepingDataStoresInSync.test.js","names":["KeepingDataStoresInSyncTest","test","badStoreDest","resolvePath","diskUtil","deleteFile","assert","isFunction","Action","execute","syncStores","results","isLength","files","writeFile","isArray","errors","errorAssert","assertError","file","nameReadable","nameReadablePlural","namePascal","validateFiles","typesFile","testUtil","assertFileByNameInGeneratedFiles","mapFile","Promise","all","Service","check","AbstractSkillTest"],"sources":["../../../../src/__tests__/behavioral/stores/KeepingDataStoresInSync.test.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test-utils'\nimport { errorAssert } from '@sprucelabs/test-utils'\nimport { FeatureActionResponse } from '../../../features/features.types'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class KeepingDataStoresInSyncTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'stores'\n\tprotected static badStoreDest: string\n\tprotected static async beforeAll() {\n\t\tawait super.beforeAll()\n\t\tthis.badStoreDest = this.resolvePath('src/stores/Bad.store.ts')\n\t}\n\n\tprotected static async beforeEach() {\n\t\tawait super.beforeEach()\n\t\tdiskUtil.deleteFile(this.badStoreDest)\n\t}\n\n\t@test()\n\tprotected static async hasSyncAction() {\n\t\tassert.isFunction(this.Action('store', 'sync').execute)\n\t}\n\n\t@test()\n\tprotected static async syncsNothingToStart() {\n\t\tconst results = await this.syncStores()\n\n\t\tassert.isLength(results.files, 0)\n\t}\n\n\t@test()\n\tprotected static async badFileReturnsError() {\n\t\tdiskUtil.writeFile(this.badStoreDest, 'throw new Error(\"Cheese!\")')\n\n\t\tconst results = await this.syncStores()\n\t\tassert.isArray(results.errors)\n\t\tassert.isLength(results.errors, 1)\n\n\t\terrorAssert.assertError(results.errors[0], 'FAILED_TO_IMPORT', {\n\t\t\tfile: 'Bad.store.ts',\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async generatesValidTypeFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tawait this.validateFiles(results)\n\t}\n\n\t@test()\n\tprotected static async fileIsValidAfterSync() {\n\t\tconst results = await this.syncStores()\n\n\t\tawait this.validateFiles(results)\n\t}\n\n\t@test()\n\tprotected static async canAddSecondStore() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Person',\n\t\t\tnameReadablePlural: 'People',\n\t\t\tnamePascal: 'Person',\n\t\t})\n\n\t\tawait this.validateFiles(results)\n\t}\n\n\tprivate static async validateFiles(results: FeatureActionResponse) {\n\t\tconst typesFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'stores.types.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst mapFile = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'stores.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait Promise.all([\n\t\t\tthis.Service('typeChecker').check(typesFile),\n\t\t\tthis.Service('typeChecker').check(mapFile),\n\t\t])\n\t}\n\n\tprivate static async syncStores() {\n\t\treturn this.Action('store', 'sync').execute({})\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;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AAT,CACjB,iBADiB,EAEjBf,OAAO,CAACE,KAFS,CADnB;gBAMOc,OANP,GAMiBF,gBAAA,CAASC,gCAAT,CACf,WADe,EAEff,OAAO,CAACE,KAFO,CANjB;gBAAA;gBAAA,OAWOe,OAAO,CAACC,GAAR,CAAY,CACjB,KAAKC,OAAL,CAAa,aAAb,EAA4BC,KAA5B,CAAkCP,SAAlC,CADiB,EAEjB,KAAKM,OAAL,CAAa,aAAb,EAA4BC,KAA5B,CAAkCJ,OAAlC,CAFiB,CAAZ,CAXP;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;sGAiBA;QAAA;UAAA;YAAA;cAAA;gBAAA,mCACQ,KAAKnB,MAAL,CAAY,OAAZ,EAAqB,MAArB,EAA6BC,OAA7B,CAAqC,EAArC,CADR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EApFwDuB,8B,8DACvB,Q"}
|
|
@@ -25,13 +25,13 @@ var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/
|
|
|
25
25
|
|
|
26
26
|
var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _testUtils = require("@sprucelabs/test-utils");
|
|
29
29
|
|
|
30
30
|
var _LintService = _interopRequireDefault(require("../../../services/LintService"));
|
|
31
31
|
|
|
32
32
|
var _AbstractTestTest2 = _interopRequireDefault(require("../../../tests/AbstractTestTest"));
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _test = _interopRequireDefault(require("../../../tests/utilities/test.utility"));
|
|
35
35
|
|
|
36
36
|
var _uiAssert = _interopRequireDefault(require("../../../tests/utilities/uiAssert.utility"));
|
|
37
37
|
|
|
@@ -41,7 +41,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
41
41
|
|
|
42
42
|
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; } }
|
|
43
43
|
|
|
44
|
-
var CreatingBehavioralTestsTest = (_dec = (0,
|
|
44
|
+
var CreatingBehavioralTestsTest = (_dec = (0, _testUtils.test)(), _dec2 = (0, _testUtils.test)(), _dec3 = (0, _testUtils.test)('can create behavioral test with AbstractSpruceFixtureTest', 'AbstractSpruceFixtureTest'), _dec4 = (0, _testUtils.test)('can create behavioral test with AbstractStoreTest', 'AbstractStoreTest (requires install)'), _dec5 = (0, _testUtils.test)('finds folders inside behavioral', 'behavioral'), _dec6 = (0, _testUtils.test)('finds folders inside implementation', 'implementation'), _dec7 = (0, _testUtils.test)(), _dec8 = (0, _testUtils.test)('can select sub dir 1', 'test'), _dec9 = (0, _testUtils.test)('can select sub dir 2', 'test-2'), _dec10 = (0, _testUtils.test)(), _dec11 = (0, _testUtils.test)(), (_class = /*#__PURE__*/function (_AbstractTestTest) {
|
|
45
45
|
(0, _inherits2["default"])(CreatingBehavioralTestsTest, _AbstractTestTest);
|
|
46
46
|
|
|
47
47
|
var _super = _createSuper(CreatingBehavioralTestsTest);
|
|
@@ -59,7 +59,7 @@ var CreatingBehavioralTestsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
|
|
|
59
59
|
while (1) {
|
|
60
60
|
switch (_context.prev = _context.next) {
|
|
61
61
|
case 0:
|
|
62
|
-
|
|
62
|
+
_testUtils.assert.isFunction(this.Action('test', 'create').execute);
|
|
63
63
|
|
|
64
64
|
case 1:
|
|
65
65
|
case "end":
|
|
@@ -95,7 +95,7 @@ var CreatingBehavioralTestsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
|
|
|
95
95
|
case 5:
|
|
96
96
|
candidates = _context2.sent;
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
_testUtils.assert.doesInclude(candidates, {
|
|
99
99
|
label: 'AbstractSpruceFixtureTest (requires install)',
|
|
100
100
|
name: 'AbstractSpruceFixtureTest'
|
|
101
101
|
});
|
|
@@ -133,14 +133,14 @@ var CreatingBehavioralTestsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
|
|
|
133
133
|
case 3:
|
|
134
134
|
match = _context3.sent;
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
_testUtils.assert.doesInclude(match, 'behavioral');
|
|
137
137
|
|
|
138
138
|
_context3.next = 7;
|
|
139
139
|
return this.Service('build').build();
|
|
140
140
|
|
|
141
141
|
case 7:
|
|
142
142
|
_context3.next = 9;
|
|
143
|
-
return
|
|
143
|
+
return _testUtils.assert.doesThrowAsync(function () {
|
|
144
144
|
return _this.Service('command').execute('yarn test');
|
|
145
145
|
}, /false[\s\S]*?does not equal[\s\S]*?true/gi);
|
|
146
146
|
|
|
@@ -306,7 +306,7 @@ var CreatingBehavioralTestsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
|
|
|
306
306
|
results = _context6.sent;
|
|
307
307
|
expectedPath = this.resolvePath('src', '__tests__', 'behavioral', dirName, 'CanBookAppointment.test.ts');
|
|
308
308
|
|
|
309
|
-
|
|
309
|
+
_testUtils.assert.isEqual(expectedPath, (_results$files = results.files) === null || _results$files === void 0 ? void 0 : (_results$files$ = _results$files[0]) === null || _results$files$ === void 0 ? void 0 : _results$files$.path);
|
|
310
310
|
|
|
311
311
|
case 16:
|
|
312
312
|
case "end":
|
|
@@ -378,7 +378,7 @@ var CreatingBehavioralTestsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
|
|
|
378
378
|
testFile = _context8.sent;
|
|
379
379
|
contents = _spruceSkillUtils.diskUtil.readFile(testFile);
|
|
380
380
|
|
|
381
|
-
|
|
381
|
+
_testUtils.assert.doesInclude(contents, 'fake.login()');
|
|
382
382
|
|
|
383
383
|
case 5:
|
|
384
384
|
case "end":
|
|
@@ -540,7 +540,7 @@ var CreatingBehavioralTestsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.t
|
|
|
540
540
|
|
|
541
541
|
case 2:
|
|
542
542
|
response = _context12.sent;
|
|
543
|
-
match =
|
|
543
|
+
match = _test["default"].assertFileByNameInGeneratedFiles('CanBookAppointment.test.ts', response.files);
|
|
544
544
|
return _context12.abrupt("return", match);
|
|
545
545
|
|
|
546
546
|
case 5:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatingATest.test.js","names":["CreatingBehavioralTestsTest","test","assert","isFunction","Action","execute","installTests","testFeature","getFeatureInstaller","getFeature","buildParentClassCandidates","candidates","doesInclude","label","name","testName","LintService","enableLinting","createTestAndGetFile","match","Service","build","doesThrowAsync","testType","createTestSubDir","installAndStartTestActionAndWaitForInput","promise","uiAssert","assertSelectRenderChoice","ui","sendInput","waitAndSelectSubClass","dirs","dir","dirName","results","expectedPath","resolvePath","isEqual","files","path","file","resolveTestDir","diskUtil","writeFile","assertSelectDidNotRenderChoice","reset","testFile","contents","readFile","newDir","createDir","testDirs","selectOptionBasedOnLabel","response","type","nameReadable","nameCamel","namePascal","waitForInput","selectedSubClass","createTest","testUtil","assertFileByNameInGeneratedFiles","AbstractTestTest"],"sources":["../../../../src/__tests__/behavioral/tests/CreatingATest.test.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport LintService from '../../../services/LintService'\nimport AbstractTestTest from '../../../tests/AbstractTestTest'\nimport testUtil from '../../../tests/utilities/test.utility'\nimport uiAssert from '../../../tests/utilities/uiAssert.utility'\n\nexport default class CreatingBehavioralTestsTest extends AbstractTestTest {\n\t@test()\n\tprotected static async hasCreateAction() {\n\t\tassert.isFunction(this.Action('test', 'create').execute)\n\t}\n\n\t@test()\n\tprotected static async requiresInstallIfFeatureNotInstalled() {\n\t\tawait this.installTests('testsInNodeModule')\n\n\t\tconst testFeature = this.getFeatureInstaller().getFeature('test')\n\t\tconst candidates = await testFeature.buildParentClassCandidates()\n\n\t\tassert.doesInclude(candidates, {\n\t\t\tlabel: 'AbstractSpruceFixtureTest (requires install)',\n\t\t\tname: 'AbstractSpruceFixtureTest',\n\t\t})\n\t}\n\n\t@test(\n\t\t'can create behavioral test with AbstractSpruceFixtureTest',\n\t\t'AbstractSpruceFixtureTest'\n\t)\n\t@test(\n\t\t'can create behavioral test with AbstractStoreTest',\n\t\t'AbstractStoreTest (requires install)'\n\t)\n\tprotected static async canCreateBehavioralTest(testName: string) {\n\t\tLintService.enableLinting()\n\t\tconst match = await this.createTestAndGetFile(testName)\n\n\t\tassert.doesInclude(match, 'behavioral')\n\n\t\tawait this.Service('build').build()\n\n\t\tawait assert.doesThrowAsync(\n\t\t\t() => this.Service('command').execute('yarn test'),\n\t\t\t/false.*?does not equal.*?true/gis\n\t\t)\n\t}\n\n\t@test('finds folders inside behavioral', 'behavioral')\n\t@test('finds folders inside implementation', 'implementation')\n\tprotected static async promptsToSelectFolderIfInsideTestDir(\n\t\ttestType: string\n\t) {\n\t\tawait this.installTests()\n\n\t\tthis.createTestSubDir(testType, 'dummy1')\n\n\t\tconst { promise } = await this.installAndStartTestActionAndWaitForInput(\n\t\t\ttestType\n\t\t)\n\n\t\tuiAssert.assertSelectRenderChoice(this.ui, '.', testType)\n\t\tuiAssert.assertSelectRenderChoice(this.ui, `dummy1`, `${testType}/dummy1`)\n\n\t\tawait this.ui.sendInput('.')\n\t\tawait this.waitAndSelectSubClass()\n\n\t\tawait promise\n\t}\n\n\t@test()\n\tprotected static async listsManyDirsIfExistInsideTestDir() {\n\t\tawait this.installTests()\n\n\t\tconst dirs = ['dir1', 'dir2', 'dir3']\n\n\t\tfor (const dir of dirs) {\n\t\t\tthis.createTestSubDir('behavioral', dir)\n\t\t}\n\n\t\tconst { promise } = await this.installAndStartTestActionAndWaitForInput()\n\n\t\tfor (const dir of dirs) {\n\t\t\tuiAssert.assertSelectRenderChoice(this.ui, `${dir}`, `behavioral/${dir}`)\n\t\t}\n\n\t\tawait this.ui.sendInput('.')\n\n\t\tawait this.waitAndSelectSubClass()\n\n\t\tawait promise\n\t}\n\n\t@test('can select sub dir 1', 'test')\n\t@test('can select sub dir 2', 'test-2')\n\tprotected static async selectingAnOptionRendersToSubDir(dirName: string) {\n\t\tawait this.installTests()\n\t\tthis.createTestSubDir('behavioral', dirName)\n\n\t\tconst { promise } = await this.installAndStartTestActionAndWaitForInput(\n\t\t\t'behavioral'\n\t\t)\n\n\t\tawait this.ui.sendInput(`${dirName}`)\n\n\t\tawait this.waitAndSelectSubClass()\n\n\t\tconst results = await promise\n\n\t\tconst expectedPath = this.resolvePath(\n\t\t\t'src',\n\t\t\t'__tests__',\n\t\t\t'behavioral',\n\t\t\tdirName,\n\t\t\t'CanBookAppointment.test.ts'\n\t\t)\n\n\t\tassert.isEqual(expectedPath, results.files?.[0]?.path)\n\t}\n\n\t@test()\n\tprotected static async doesNotListFiles() {\n\t\tawait this.installTests()\n\t\tthis.createTestSubDir('behavioral', 'subdir')\n\n\t\tconst file = this.resolveTestDir('behavioral', 'test.ts')\n\t\tdiskUtil.writeFile(file, 'what the!?')\n\n\t\tawait this.installAndStartTestActionAndWaitForInput()\n\n\t\tuiAssert.assertSelectDidNotRenderChoice(\n\t\t\tthis.ui,\n\t\t\t'test',\n\t\t\t`behavioral/test/test.ts`\n\t\t)\n\n\t\tthis.ui.reset()\n\t}\n\n\t@test()\n\tprotected static async allTestsComeFakedToStart() {\n\t\tconst testFile = await this.createTestAndGetFile()\n\t\tconst contents = diskUtil.readFile(testFile)\n\t\tassert.doesInclude(contents, 'fake.login()')\n\t}\n\n\tprivate static createTestSubDir(...testDirs: string[]) {\n\t\tconst newDir = this.resolveTestDir(...testDirs)\n\t\tdiskUtil.createDir(newDir)\n\t}\n\n\tprivate static resolveTestDir(...testDirs: string[]) {\n\t\treturn this.resolvePath('src', '__tests__', ...testDirs)\n\t}\n\n\tprivate static async createTest(testName = 'AbstractSpruceFixtureTest') {\n\t\tconst { promise } = await this.installAndStartTestActionAndWaitForInput()\n\n\t\tthis.selectOptionBasedOnLabel(testName)\n\n\t\tconst response = await promise\n\t\treturn response\n\t}\n\n\tprivate static async installAndStartTestActionAndWaitForInput(\n\t\ttestType = 'behavioral'\n\t) {\n\t\tawait this.installTests()\n\t\tconst promise = this.Action('test', 'create').execute({\n\t\t\ttype: testType,\n\t\t\tnameReadable: 'Can book appointment',\n\t\t\tnameCamel: 'canBookAppointment',\n\t\t\tnamePascal: 'CanBookAppointment',\n\t\t})\n\n\t\tawait this.waitForInput()\n\t\treturn { promise }\n\t}\n\n\tprivate static async waitAndSelectSubClass(selectedSubClass?: string) {\n\t\tawait this.waitForInput()\n\t\tawait this.ui.sendInput(selectedSubClass ?? '')\n\t}\n\n\tprivate static async createTestAndGetFile(testName?: string) {\n\t\tconst response = await this.createTest(testName)\n\n\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'CanBookAppointment.test.ts',\n\t\t\tresponse.files\n\t\t)\n\t\treturn match\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,2B,WACnB,IAAAC,UAAA,G,UAKA,IAAAA,UAAA,G,UAaA,IAAAA,UAAA,EACA,2DADA,EAEA,2BAFA,C,UAIA,IAAAA,UAAA,EACA,mDADA,EAEA,sCAFA,C,UAkBA,IAAAA,UAAA,EAAK,iCAAL,EAAwC,YAAxC,C,UACA,IAAAA,UAAA,EAAK,qCAAL,EAA4C,gBAA5C,C,UAqBA,IAAAA,UAAA,G,UAuBA,IAAAA,UAAA,EAAK,sBAAL,EAA6B,MAA7B,C,UACA,IAAAA,UAAA,EAAK,sBAAL,EAA6B,QAA7B,C,WA0BA,IAAAA,UAAA,G,WAmBA,IAAAA,UAAA,G;;;;;;;;;;;;;2GAnID;QAAA;UAAA;YAAA;cAAA;gBAECC,YAAA,CAAOC,UAAP,CAAkB,KAAKC,MAAL,CAAY,MAAZ,EAAoB,QAApB,EAA8BC,OAAhD;;cAF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BAA2CkC,gBAA3C;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACO,KAAKD,YAAL,EADP;;cAAA;gBAAA;gBAAA,OAEO,KAAK9B,EAAL,CAAQC,SAAR,CAAkB8B,gBAAlB,aAAkBA,gBAAlB,cAAkBA,gBAAlB,GAAsC,EAAtC,CAFP;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;gHAKA,mBAA0C7C,QAA1C;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACwB,KAAK8C,UAAL,CAAgB9C,QAAhB,CADxB;;cAAA;gBACOuC,QADP;gBAGOnC,KAHP,GAGe2C,iBAAA,CAASC,gCAAT,CACb,4BADa,EAEbT,QAAQ,CAACf,KAFI,CAHf;gBAAA,mCAOQpB,KAPR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EAjLwD6C,6B"}
|
|
1
|
+
{"version":3,"file":"CreatingATest.test.js","names":["CreatingBehavioralTestsTest","test","assert","isFunction","Action","execute","installTests","testFeature","getFeatureInstaller","getFeature","buildParentClassCandidates","candidates","doesInclude","label","name","testName","LintService","enableLinting","createTestAndGetFile","match","Service","build","doesThrowAsync","testType","createTestSubDir","installAndStartTestActionAndWaitForInput","promise","uiAssert","assertSelectRenderChoice","ui","sendInput","waitAndSelectSubClass","dirs","dir","dirName","results","expectedPath","resolvePath","isEqual","files","path","file","resolveTestDir","diskUtil","writeFile","assertSelectDidNotRenderChoice","reset","testFile","contents","readFile","newDir","createDir","testDirs","selectOptionBasedOnLabel","response","type","nameReadable","nameCamel","namePascal","waitForInput","selectedSubClass","createTest","testUtil","assertFileByNameInGeneratedFiles","AbstractTestTest"],"sources":["../../../../src/__tests__/behavioral/tests/CreatingATest.test.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test-utils'\nimport LintService from '../../../services/LintService'\nimport AbstractTestTest from '../../../tests/AbstractTestTest'\nimport testUtil from '../../../tests/utilities/test.utility'\nimport uiAssert from '../../../tests/utilities/uiAssert.utility'\n\nexport default class CreatingBehavioralTestsTest extends AbstractTestTest {\n\t@test()\n\tprotected static async hasCreateAction() {\n\t\tassert.isFunction(this.Action('test', 'create').execute)\n\t}\n\n\t@test()\n\tprotected static async requiresInstallIfFeatureNotInstalled() {\n\t\tawait this.installTests('testsInNodeModule')\n\n\t\tconst testFeature = this.getFeatureInstaller().getFeature('test')\n\t\tconst candidates = await testFeature.buildParentClassCandidates()\n\n\t\tassert.doesInclude(candidates, {\n\t\t\tlabel: 'AbstractSpruceFixtureTest (requires install)',\n\t\t\tname: 'AbstractSpruceFixtureTest',\n\t\t})\n\t}\n\n\t@test(\n\t\t'can create behavioral test with AbstractSpruceFixtureTest',\n\t\t'AbstractSpruceFixtureTest'\n\t)\n\t@test(\n\t\t'can create behavioral test with AbstractStoreTest',\n\t\t'AbstractStoreTest (requires install)'\n\t)\n\tprotected static async canCreateBehavioralTest(testName: string) {\n\t\tLintService.enableLinting()\n\t\tconst match = await this.createTestAndGetFile(testName)\n\n\t\tassert.doesInclude(match, 'behavioral')\n\n\t\tawait this.Service('build').build()\n\n\t\tawait assert.doesThrowAsync(\n\t\t\t() => this.Service('command').execute('yarn test'),\n\t\t\t/false.*?does not equal.*?true/gis\n\t\t)\n\t}\n\n\t@test('finds folders inside behavioral', 'behavioral')\n\t@test('finds folders inside implementation', 'implementation')\n\tprotected static async promptsToSelectFolderIfInsideTestDir(\n\t\ttestType: string\n\t) {\n\t\tawait this.installTests()\n\n\t\tthis.createTestSubDir(testType, 'dummy1')\n\n\t\tconst { promise } = await this.installAndStartTestActionAndWaitForInput(\n\t\t\ttestType\n\t\t)\n\n\t\tuiAssert.assertSelectRenderChoice(this.ui, '.', testType)\n\t\tuiAssert.assertSelectRenderChoice(this.ui, `dummy1`, `${testType}/dummy1`)\n\n\t\tawait this.ui.sendInput('.')\n\t\tawait this.waitAndSelectSubClass()\n\n\t\tawait promise\n\t}\n\n\t@test()\n\tprotected static async listsManyDirsIfExistInsideTestDir() {\n\t\tawait this.installTests()\n\n\t\tconst dirs = ['dir1', 'dir2', 'dir3']\n\n\t\tfor (const dir of dirs) {\n\t\t\tthis.createTestSubDir('behavioral', dir)\n\t\t}\n\n\t\tconst { promise } = await this.installAndStartTestActionAndWaitForInput()\n\n\t\tfor (const dir of dirs) {\n\t\t\tuiAssert.assertSelectRenderChoice(this.ui, `${dir}`, `behavioral/${dir}`)\n\t\t}\n\n\t\tawait this.ui.sendInput('.')\n\n\t\tawait this.waitAndSelectSubClass()\n\n\t\tawait promise\n\t}\n\n\t@test('can select sub dir 1', 'test')\n\t@test('can select sub dir 2', 'test-2')\n\tprotected static async selectingAnOptionRendersToSubDir(dirName: string) {\n\t\tawait this.installTests()\n\t\tthis.createTestSubDir('behavioral', dirName)\n\n\t\tconst { promise } = await this.installAndStartTestActionAndWaitForInput(\n\t\t\t'behavioral'\n\t\t)\n\n\t\tawait this.ui.sendInput(`${dirName}`)\n\n\t\tawait this.waitAndSelectSubClass()\n\n\t\tconst results = await promise\n\n\t\tconst expectedPath = this.resolvePath(\n\t\t\t'src',\n\t\t\t'__tests__',\n\t\t\t'behavioral',\n\t\t\tdirName,\n\t\t\t'CanBookAppointment.test.ts'\n\t\t)\n\n\t\tassert.isEqual(expectedPath, results.files?.[0]?.path)\n\t}\n\n\t@test()\n\tprotected static async doesNotListFiles() {\n\t\tawait this.installTests()\n\t\tthis.createTestSubDir('behavioral', 'subdir')\n\n\t\tconst file = this.resolveTestDir('behavioral', 'test.ts')\n\t\tdiskUtil.writeFile(file, 'what the!?')\n\n\t\tawait this.installAndStartTestActionAndWaitForInput()\n\n\t\tuiAssert.assertSelectDidNotRenderChoice(\n\t\t\tthis.ui,\n\t\t\t'test',\n\t\t\t`behavioral/test/test.ts`\n\t\t)\n\n\t\tthis.ui.reset()\n\t}\n\n\t@test()\n\tprotected static async allTestsComeFakedToStart() {\n\t\tconst testFile = await this.createTestAndGetFile()\n\t\tconst contents = diskUtil.readFile(testFile)\n\t\tassert.doesInclude(contents, 'fake.login()')\n\t}\n\n\tprivate static createTestSubDir(...testDirs: string[]) {\n\t\tconst newDir = this.resolveTestDir(...testDirs)\n\t\tdiskUtil.createDir(newDir)\n\t}\n\n\tprivate static resolveTestDir(...testDirs: string[]) {\n\t\treturn this.resolvePath('src', '__tests__', ...testDirs)\n\t}\n\n\tprivate static async createTest(testName = 'AbstractSpruceFixtureTest') {\n\t\tconst { promise } = await this.installAndStartTestActionAndWaitForInput()\n\n\t\tthis.selectOptionBasedOnLabel(testName)\n\n\t\tconst response = await promise\n\t\treturn response\n\t}\n\n\tprivate static async installAndStartTestActionAndWaitForInput(\n\t\ttestType = 'behavioral'\n\t) {\n\t\tawait this.installTests()\n\t\tconst promise = this.Action('test', 'create').execute({\n\t\t\ttype: testType,\n\t\t\tnameReadable: 'Can book appointment',\n\t\t\tnameCamel: 'canBookAppointment',\n\t\t\tnamePascal: 'CanBookAppointment',\n\t\t})\n\n\t\tawait this.waitForInput()\n\t\treturn { promise }\n\t}\n\n\tprivate static async waitAndSelectSubClass(selectedSubClass?: string) {\n\t\tawait this.waitForInput()\n\t\tawait this.ui.sendInput(selectedSubClass ?? '')\n\t}\n\n\tprivate static async createTestAndGetFile(testName?: string) {\n\t\tconst response = await this.createTest(testName)\n\n\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'CanBookAppointment.test.ts',\n\t\t\tresponse.files\n\t\t)\n\t\treturn match\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,2B,WACnB,IAAAC,eAAA,G,UAKA,IAAAA,eAAA,G,UAaA,IAAAA,eAAA,EACA,2DADA,EAEA,2BAFA,C,UAIA,IAAAA,eAAA,EACA,mDADA,EAEA,sCAFA,C,UAkBA,IAAAA,eAAA,EAAK,iCAAL,EAAwC,YAAx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B,KAAKtB,MAAL,CAAY,MAAZ,EAAoB,QAApB,EAA8BC,OAA9B,CAAsC;kBACrDkD,IAAI,EAAEhC,QAD+C;kBAErDiC,YAAY,EAAE,sBAFuC;kBAGrDC,SAAS,EAAE,oBAH0C;kBAIrDC,UAAU,EAAE;gBAJyC,CAAtC,CAJjB;gBAAA;gBAAA,OAWO,KAAKC,YAAL,EAXP;;cAAA;gBAAA,mCAYQ;kBAAEjC,OAAO,EAAPA;gBAAF,CAZR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;iHAeA,mBAA2CkC,gBAA3C;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACO,KAAKD,YAAL,EADP;;cAAA;gBAAA;gBAAA,OAEO,KAAK9B,EAAL,CAAQC,SAAR,CAAkB8B,gBAAlB,aAAkBA,gBAAlB,cAAkBA,gBAAlB,GAAsC,EAAtC,CAFP;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;gHAKA,mBAA0C7C,QAA1C;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACwB,KAAK8C,UAAL,CAAgB9C,QAAhB,CADxB;;cAAA;gBACOuC,QADP;gBAGOnC,KAHP,GAGe2C,gBAAA,CAASC,gCAAT,CACb,4BADa,EAEbT,QAAQ,CAACf,KAFI,CAHf;gBAAA,mCAOQpB,KAPR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EAjLwD6C,6B"}
|
|
@@ -23,8 +23,6 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
23
23
|
|
|
24
24
|
var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/helpers/applyDecoratedDescriptor"));
|
|
25
25
|
|
|
26
|
-
var _test = require("@sprucelabs/test");
|
|
27
|
-
|
|
28
26
|
var _testUtils = require("@sprucelabs/test-utils");
|
|
29
27
|
|
|
30
28
|
var _AbstractTestTest2 = _interopRequireDefault(require("../../../tests/AbstractTestTest"));
|
|
@@ -35,7 +33,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
35
33
|
|
|
36
34
|
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; } }
|
|
37
35
|
|
|
38
|
-
var RunningTestsTest = (_dec = (0,
|
|
36
|
+
var RunningTestsTest = (_dec = (0, _testUtils.test)(), _dec2 = (0, _testUtils.test)(), (_class = /*#__PURE__*/function (_AbstractTestTest) {
|
|
39
37
|
(0, _inherits2["default"])(RunningTestsTest, _AbstractTestTest);
|
|
40
38
|
|
|
41
39
|
var _super = _createSuper(RunningTestsTest);
|
|
@@ -57,7 +55,7 @@ var RunningTestsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), (_c
|
|
|
57
55
|
return this.Cli();
|
|
58
56
|
|
|
59
57
|
case 2:
|
|
60
|
-
|
|
58
|
+
_testUtils.assert.isFunction(this.Action('test', 'test').execute);
|
|
61
59
|
|
|
62
60
|
case 3:
|
|
63
61
|
case "end":
|
|
@@ -109,7 +107,7 @@ var RunningTestsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), (_c
|
|
|
109
107
|
creationResults = _context2.sent;
|
|
110
108
|
file = (_creationResults$file = creationResults.files) === null || _creationResults$file === void 0 ? void 0 : _creationResults$file[0];
|
|
111
109
|
|
|
112
|
-
|
|
110
|
+
_testUtils.assert.isTruthy(file);
|
|
113
111
|
|
|
114
112
|
this.fixBadTest(file.path);
|
|
115
113
|
promise = this.Action('test', 'create').execute({
|
|
@@ -142,17 +140,17 @@ var RunningTestsTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), (_c
|
|
|
142
140
|
case 24:
|
|
143
141
|
results = _context2.sent;
|
|
144
142
|
|
|
145
|
-
|
|
143
|
+
_testUtils.assert.isTruthy(results.errors);
|
|
146
144
|
|
|
147
|
-
|
|
145
|
+
_testUtils.assert.isLength(results.errors, 1);
|
|
148
146
|
|
|
149
147
|
_testUtils.errorAssert.assertError(results.errors[0], 'TEST_FAILED');
|
|
150
148
|
|
|
151
|
-
|
|
149
|
+
_testUtils.assert.isTruthy(results.meta);
|
|
152
150
|
|
|
153
|
-
|
|
151
|
+
_testUtils.assert.isTruthy((_results$meta = results.meta) === null || _results$meta === void 0 ? void 0 : _results$meta.testResults);
|
|
154
152
|
|
|
155
|
-
|
|
153
|
+
_testUtils.assert.doesInclude((_results$meta2 = results.meta) === null || _results$meta2 === void 0 ? void 0 : _results$meta2.testResults, {
|
|
156
154
|
wasKilled: false,
|
|
157
155
|
totalTestFiles: 2,
|
|
158
156
|
totalTestFilesComplete: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunningTests.test.js","names":["RunningTestsTest","test","Cli","assert","isFunction","Action","execute","installTests","creationPromise","type","nameReadable","nameCamel","namePascal","waitForInput","ui","sendInput","creationResults","file","files","isTruthy","fixBadTest","path","promise","Service","build","shouldReportWhileRunning","results","errors","isLength","errorAssert","assertError","meta","testResults","doesInclude","wasKilled","totalTestFiles","totalTestFilesComplete","totalFailed","totalPassed","totalSkipped","totalTests","totalTodo","AbstractTestTest"],"sources":["../../../../src/__tests__/behavioral/tests/RunningTests.test.ts"],"sourcesContent":["import { test, assert } from '@sprucelabs/test'\nimport { errorAssert } from '@sprucelabs/test-utils'\nimport AbstractTestTest from '../../../tests/AbstractTestTest'\n\nexport default class RunningTestsTest extends AbstractTestTest {\n\t@test()\n\tprotected static async hasTestAction() {\n\t\tawait this.Cli()\n\t\tassert.isFunction(this.Action('test', 'test').execute)\n\t}\n\n\t@test()\n\tprotected static async runningTestsActuallyRunsTests() {\n\t\tawait this.installTests()\n\t\tconst creationPromise = this.Action('test', 'create').execute({\n\t\t\ttype: 'behavioral',\n\t\t\tnameReadable: 'Can book appointment',\n\t\t\tnameCamel: 'canBookAppointment',\n\t\t\tnamePascal: 'CanBookAppointment',\n\t\t})\n\n\t\tawait this.waitForInput()\n\t\tawait this.ui.sendInput('')\n\n\t\tconst creationResults = await creationPromise\n\n\t\tconst file = creationResults.files?.[0]\n\t\tassert.isTruthy(file)\n\n\t\tthis.fixBadTest(file.path)\n\n\t\tconst promise = this.Action('test', 'create').execute({\n\t\t\ttype: 'behavioral',\n\t\t\tnameReadable: 'Can cancel appointment',\n\t\t\tnameCamel: 'canCancelAppointment',\n\t\t\tnamePascal: 'CanCancelAppointment',\n\t\t})\n\n\t\tawait this.waitForInput()\n\t\tawait this.ui.sendInput('')\n\n\t\tawait promise\n\n\t\tawait this.Service('build').build()\n\n\t\tconst results = await this.Action('test', 'test').execute({\n\t\t\tshouldReportWhileRunning: false,\n\t\t})\n\n\t\tassert.isTruthy(results.errors)\n\t\tassert.isLength(results.errors, 1)\n\n\t\terrorAssert.assertError(results.errors[0], 'TEST_FAILED')\n\n\t\tassert.isTruthy(results.meta)\n\t\tassert.isTruthy(results.meta?.testResults)\n\n\t\tassert.doesInclude(results.meta?.testResults, {\n\t\t\twasKilled: false,\n\t\t\ttotalTestFiles: 2,\n\t\t\ttotalTestFilesComplete: 2,\n\t\t\ttotalFailed: 1,\n\t\t\ttotalPassed: 3,\n\t\t\ttotalSkipped: 0,\n\t\t\ttotalTests: 4,\n\t\t\ttotalTodo: 0,\n\t\t})\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"file":"RunningTests.test.js","names":["RunningTestsTest","test","Cli","assert","isFunction","Action","execute","installTests","creationPromise","type","nameReadable","nameCamel","namePascal","waitForInput","ui","sendInput","creationResults","file","files","isTruthy","fixBadTest","path","promise","Service","build","shouldReportWhileRunning","results","errors","isLength","errorAssert","assertError","meta","testResults","doesInclude","wasKilled","totalTestFiles","totalTestFilesComplete","totalFailed","totalPassed","totalSkipped","totalTests","totalTodo","AbstractTestTest"],"sources":["../../../../src/__tests__/behavioral/tests/RunningTests.test.ts"],"sourcesContent":["import { test, assert } from '@sprucelabs/test-utils'\nimport { errorAssert } from '@sprucelabs/test-utils'\nimport AbstractTestTest from '../../../tests/AbstractTestTest'\n\nexport default class RunningTestsTest extends AbstractTestTest {\n\t@test()\n\tprotected static async hasTestAction() {\n\t\tawait this.Cli()\n\t\tassert.isFunction(this.Action('test', 'test').execute)\n\t}\n\n\t@test()\n\tprotected static async runningTestsActuallyRunsTests() {\n\t\tawait this.installTests()\n\t\tconst creationPromise = this.Action('test', 'create').execute({\n\t\t\ttype: 'behavioral',\n\t\t\tnameReadable: 'Can book appointment',\n\t\t\tnameCamel: 'canBookAppointment',\n\t\t\tnamePascal: 'CanBookAppointment',\n\t\t})\n\n\t\tawait this.waitForInput()\n\t\tawait this.ui.sendInput('')\n\n\t\tconst creationResults = await creationPromise\n\n\t\tconst file = creationResults.files?.[0]\n\t\tassert.isTruthy(file)\n\n\t\tthis.fixBadTest(file.path)\n\n\t\tconst promise = this.Action('test', 'create').execute({\n\t\t\ttype: 'behavioral',\n\t\t\tnameReadable: 'Can cancel appointment',\n\t\t\tnameCamel: 'canCancelAppointment',\n\t\t\tnamePascal: 'CanCancelAppointment',\n\t\t})\n\n\t\tawait this.waitForInput()\n\t\tawait this.ui.sendInput('')\n\n\t\tawait promise\n\n\t\tawait this.Service('build').build()\n\n\t\tconst results = await this.Action('test', 'test').execute({\n\t\t\tshouldReportWhileRunning: false,\n\t\t})\n\n\t\tassert.isTruthy(results.errors)\n\t\tassert.isLength(results.errors, 1)\n\n\t\terrorAssert.assertError(results.errors[0], 'TEST_FAILED')\n\n\t\tassert.isTruthy(results.meta)\n\t\tassert.isTruthy(results.meta?.testResults)\n\n\t\tassert.doesInclude(results.meta?.testResults, {\n\t\t\twasKilled: false,\n\t\t\ttotalTestFiles: 2,\n\t\t\ttotalTestFilesComplete: 2,\n\t\t\ttotal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