@sprucelabs/spruce-test-fixtures 45.2.9 → 46.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.d.ts +7 -0
- package/build/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +41 -0
- package/build/__tests__/behavioral/DatabaseFixture.test.d.ts +7 -0
- package/build/__tests__/behavioral/DatabaseFixture.test.js +59 -0
- package/build/__tests__/behavioral/DbResetsAsExpected.test.d.ts +5 -0
- package/build/__tests__/behavioral/DbResetsAsExpected.test.js +34 -0
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +15 -0
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +109 -0
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +4 -0
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +34 -0
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +5 -0
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +26 -0
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +8 -0
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +65 -0
- package/build/__tests__/behavioral/DummyStore.d.ts +55 -0
- package/build/__tests__/behavioral/DummyStore.js +36 -0
- package/build/__tests__/behavioral/FakingEventResponses.test.d.ts +12 -0
- package/build/__tests__/behavioral/FakingEventResponses.test.js +125 -0
- package/build/__tests__/behavioral/FixtureFactory.test.d.ts +7 -0
- package/build/__tests__/behavioral/FixtureFactory.test.js +79 -0
- package/build/__tests__/behavioral/LocationFixture.test.d.ts +15 -0
- package/build/__tests__/behavioral/LocationFixture.test.js +128 -0
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +12 -0
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +92 -0
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +4 -0
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +29 -0
- package/build/__tests__/behavioral/MercuryFixture.test.d.ts +19 -0
- package/build/__tests__/behavioral/MercuryFixture.test.js +175 -0
- package/build/__tests__/behavioral/OrganizationFixture.test.d.ts +31 -0
- package/build/__tests__/behavioral/OrganizationFixture.test.js +331 -0
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +4 -0
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +21 -0
- package/build/__tests__/behavioral/PersonFixture.test.d.ts +22 -0
- package/build/__tests__/behavioral/PersonFixture.test.js +224 -0
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +11 -0
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +95 -0
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +8 -0
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +60 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +5 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +37 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +7 -0
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +44 -0
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +10 -0
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +130 -0
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +7 -0
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +42 -0
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +6 -0
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +37 -0
- package/build/__tests__/behavioral/RoleFixture.test.d.ts +15 -0
- package/build/__tests__/behavioral/RoleFixture.test.js +118 -0
- package/build/__tests__/behavioral/SeedingData.test.d.ts +24 -0
- package/build/__tests__/behavioral/SeedingData.test.js +271 -0
- package/build/__tests__/behavioral/SkillFixture.test.d.ts +13 -0
- package/build/__tests__/behavioral/SkillFixture.test.js +116 -0
- package/build/__tests__/behavioral/StoreFixture.test.d.ts +23 -0
- package/build/__tests__/behavioral/StoreFixture.test.js +156 -0
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +9 -0
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +71 -0
- package/build/__tests__/behavioral/faking/FakeDecorator.test.d.ts +45 -0
- package/build/__tests__/behavioral/faking/FakeDecorator.test.js +418 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +23 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +27 -0
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +8 -0
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +93 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +8 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +56 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +14 -0
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +141 -0
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +6 -0
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +42 -0
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +19 -0
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +140 -0
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +24 -0
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +174 -0
- package/build/__tests__/behavioral/faking/UpdatePerson.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/UpdatePerson.test.js +32 -0
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +35 -0
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +321 -0
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +4 -0
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +48 -0
- package/build/__tests__/behavioral/faking/WhoAmI.test.d.ts +19 -0
- package/build/__tests__/behavioral/faking/WhoAmI.test.js +103 -0
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +10 -0
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +76 -0
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +37 -0
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +266 -0
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +14 -0
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +113 -0
- package/build/__tests__/behavioral/views/CheckingPermissions.test.d.ts +24 -0
- package/build/__tests__/behavioral/views/CheckingPermissions.test.js +162 -0
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +12 -0
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +55 -0
- package/build/__tests__/behavioral/views/Routing.test.d.ts +31 -0
- package/build/__tests__/behavioral/views/Routing.test.js +141 -0
- package/build/__tests__/behavioral/views/TestingScope.test.d.ts +9 -0
- package/build/__tests__/behavioral/views/TestingScope.test.js +67 -0
- package/build/__tests__/behavioral/views/ViewFixture.test.d.ts +102 -0
- package/build/__tests__/behavioral/views/ViewFixture.test.js +652 -0
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +11 -0
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +55 -0
- package/build/__tests__/support/AbstractFakeDecoratorTest.d.ts +5 -0
- package/build/__tests__/support/AbstractFakeDecoratorTest.js +27 -0
- package/build/__tests__/support/EventFaker.d.ts +5 -0
- package/build/__tests__/support/EventFaker.js +36 -0
- package/build/__tests__/support/FakeThemeManager.d.ts +8 -0
- package/build/__tests__/support/FakeThemeManager.js +40 -0
- package/build/__tests__/test.types.d.ts +2 -0
- package/build/__tests__/test.types.js +2 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.d.ts +5 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/.spruce/stores/stores.js +9 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +51 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +33 -0
- package/build/__tests__/testDirsAndFiles/one-good-store-skill/src/.spruce/settings.json +6 -0
- package/build/__tests__/testDirsAndFiles/skill/build/.spruce/views/views.js +18 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +11 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +7 -0
- package/build/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +19 -0
- package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +31 -0
- package/build/__tests__/testDirsAndFiles/skill/package.json +5 -0
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/settings.json +6 -0
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.d.ts +7 -0
- package/build/__tests__/testDirsAndFiles/skill/src/.spruce/views/views.js +16 -0
- package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +11 -0
- package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +31 -0
- package/build/esm/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +53 -0
- package/build/esm/__tests__/behavioral/DatabaseFixture.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/DatabaseFixture.test.js +48 -0
- package/build/esm/__tests__/behavioral/DbResetsAsExpected.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/DbResetsAsExpected.test.js +28 -0
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +15 -0
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +125 -0
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +40 -0
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +23 -0
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +76 -0
- package/build/esm/__tests__/behavioral/DummyStore.d.ts +55 -0
- package/build/esm/__tests__/behavioral/DummyStore.js +43 -0
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.d.ts +12 -0
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +147 -0
- package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/FixtureFactory.test.js +61 -0
- package/build/esm/__tests__/behavioral/LocationFixture.test.d.ts +15 -0
- package/build/esm/__tests__/behavioral/LocationFixture.test.js +153 -0
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +12 -0
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +110 -0
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +38 -0
- package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +19 -0
- package/build/esm/__tests__/behavioral/MercuryFixture.test.js +209 -0
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.d.ts +31 -0
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +387 -0
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +18 -0
- package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +22 -0
- package/build/esm/__tests__/behavioral/PersonFixture.test.js +231 -0
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.d.ts +11 -0
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +112 -0
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +80 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +5 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +51 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +59 -0
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.d.ts +10 -0
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +139 -0
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +7 -0
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +57 -0
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.d.ts +6 -0
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +48 -0
- package/build/esm/__tests__/behavioral/RoleFixture.test.d.ts +15 -0
- package/build/esm/__tests__/behavioral/RoleFixture.test.js +143 -0
- package/build/esm/__tests__/behavioral/SeedingData.test.d.ts +24 -0
- package/build/esm/__tests__/behavioral/SeedingData.test.js +314 -0
- package/build/esm/__tests__/behavioral/SkillFixture.test.d.ts +13 -0
- package/build/esm/__tests__/behavioral/SkillFixture.test.js +139 -0
- package/build/esm/__tests__/behavioral/StoreFixture.test.d.ts +23 -0
- package/build/esm/__tests__/behavioral/StoreFixture.test.js +164 -0
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.d.ts +9 -0
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +87 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.d.ts +45 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +479 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +28 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +32 -0
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +82 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.d.ts +8 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +70 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.d.ts +14 -0
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +165 -0
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.d.ts +6 -0
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +55 -0
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.d.ts +19 -0
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +175 -0
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.d.ts +24 -0
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +214 -0
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +38 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.d.ts +35 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +360 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +4 -0
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +31 -0
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.d.ts +19 -0
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +140 -0
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.d.ts +10 -0
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +94 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.d.ts +37 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +322 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.d.ts +14 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +134 -0
- package/build/esm/__tests__/behavioral/views/CheckingPermissions.test.d.ts +24 -0
- package/build/esm/__tests__/behavioral/views/CheckingPermissions.test.js +200 -0
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.d.ts +12 -0
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +69 -0
- package/build/esm/__tests__/behavioral/views/Routing.test.d.ts +31 -0
- package/build/esm/__tests__/behavioral/views/Routing.test.js +169 -0
- package/build/esm/__tests__/behavioral/views/TestingScope.test.d.ts +9 -0
- package/build/esm/__tests__/behavioral/views/TestingScope.test.js +84 -0
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.d.ts +102 -0
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.js +731 -0
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.d.ts +11 -0
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +63 -0
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.d.ts +5 -0
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +34 -0
- package/build/esm/__tests__/support/EventFaker.d.ts +5 -0
- package/build/esm/__tests__/support/EventFaker.js +45 -0
- package/build/esm/__tests__/support/FakeThemeManager.d.ts +8 -0
- package/build/esm/__tests__/support/FakeThemeManager.js +37 -0
- package/build/esm/__tests__/test.types.d.ts +2 -0
- package/build/esm/__tests__/test.types.js +1 -0
- package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.d.ts +51 -0
- package/build/esm/__tests__/testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js +41 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Book.svc.js +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.d.ts +7 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/skillViewControllers/Spy.svc.js +27 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/build/viewControllers/BookForm.vc.js +25 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.d.ts +5 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/skillViewControllers/Book.svc.js +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.d.ts +8 -0
- package/build/esm/__tests__/testDirsAndFiles/skill/src/viewControllers/BookForm.vc.js +25 -0
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/tests/fixtures/ViewFixture.d.ts +1 -0
- package/build/esm/tests/fixtures/ViewFixture.js +4 -1
- package/build/esm/tests/routers/TestRouter.d.ts +3 -0
- package/build/esm/tests/routers/TestRouter.js +6 -0
- package/build/esm/utilities/vcDisk.utility.js +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -1
- package/build/tests/fixtures/ViewFixture.d.ts +1 -0
- package/build/tests/fixtures/ViewFixture.js +4 -1
- package/build/tests/routers/TestRouter.d.ts +3 -0
- package/build/tests/routers/TestRouter.js +6 -0
- package/build/utilities/vcDisk.utility.js +1 -0
- package/package.json +19 -19
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { test, assert } from '@sprucelabs/test';
|
|
8
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
|
9
|
+
import seed from '../../tests/decorators/seed.js';
|
|
10
|
+
import StoreFixture from '../../tests/fixtures/StoreFixture.js';
|
|
11
|
+
// eslint-disable-next-line spruce/prohibit-import-from-build-folder
|
|
12
|
+
import GoodStore from '../testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js';
|
|
13
|
+
//do not seed anything else here, this test is to ensure db settings are reset before any
|
|
14
|
+
//seed is called
|
|
15
|
+
export default class DbResetsAsExpectedTest extends AbstractSpruceFixtureTest {
|
|
16
|
+
static shouldBeReset() {
|
|
17
|
+
assert.isEqual(process.env.DB_NAME, 'memory');
|
|
18
|
+
assert.isEqual(process.env.DB_CONNECTION_STRING, 'memory://');
|
|
19
|
+
}
|
|
20
|
+
static doesNothing() { }
|
|
21
|
+
}
|
|
22
|
+
__decorate([
|
|
23
|
+
test()
|
|
24
|
+
], DbResetsAsExpectedTest, "shouldBeReset", null);
|
|
25
|
+
__decorate([
|
|
26
|
+
seed('good', 1)
|
|
27
|
+
], DbResetsAsExpectedTest, "doesNothing", null);
|
|
28
|
+
StoreFixture.setStore('good', GoodStore);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AbstractSpruceFixtureTest } from '../..';
|
|
2
|
+
export default class DecoratingEmitToPassThroughProxyTest extends AbstractSpruceFixtureTest {
|
|
3
|
+
private static lastInstance;
|
|
4
|
+
protected static sharesInstance(): void;
|
|
5
|
+
protected static canClearInstance(): void;
|
|
6
|
+
protected static canGetAndSetProxyGenerator(): void;
|
|
7
|
+
protected static canSetDefaultProxyPassThrough(id: string): Promise<void>;
|
|
8
|
+
protected static canSetTokenWhileDecorating(): Promise<void>;
|
|
9
|
+
protected static decoratorPassProps(): Promise<void>;
|
|
10
|
+
private static assertPropsCopied;
|
|
11
|
+
protected static instanceIsSameEachTest(): Promise<void>;
|
|
12
|
+
protected static loginSetsUpProxyTokenGenerator(): Promise<void>;
|
|
13
|
+
private static assertProxyEquals;
|
|
14
|
+
private static getDecorator;
|
|
15
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { test, assert } from '@sprucelabs/test';
|
|
17
|
+
import { AbstractSpruceFixtureTest, login } from '../../index.js';
|
|
18
|
+
import ClientProxyDecorator from '../../ClientProxyDecorator.js';
|
|
19
|
+
import { DEMO_NUMBER } from '../../tests/constants.js';
|
|
20
|
+
let DecoratingEmitToPassThroughProxyTest = class DecoratingEmitToPassThroughProxyTest extends AbstractSpruceFixtureTest {
|
|
21
|
+
static sharesInstance() {
|
|
22
|
+
const instance = this.getDecorator();
|
|
23
|
+
assert.isEqual(instance, ClientProxyDecorator.getInstance());
|
|
24
|
+
}
|
|
25
|
+
static canClearInstance() {
|
|
26
|
+
const instance = this.getDecorator();
|
|
27
|
+
ClientProxyDecorator.clearInstance();
|
|
28
|
+
assert.isNotEqual(instance, this.getDecorator());
|
|
29
|
+
}
|
|
30
|
+
static canGetAndSetProxyGenerator() {
|
|
31
|
+
const instance = this.getDecorator();
|
|
32
|
+
const cb = () => __awaiter(this, void 0, void 0, function* () { return '12345'; });
|
|
33
|
+
instance.setProxyTokenGenerator(cb);
|
|
34
|
+
assert.isEqual(instance.getProxyTokenGenerator(), cb);
|
|
35
|
+
}
|
|
36
|
+
static canSetDefaultProxyPassThrough(id) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const instance = this.getDecorator();
|
|
39
|
+
instance.setProxyTokenGenerator(() => __awaiter(this, void 0, void 0, function* () { return id; }));
|
|
40
|
+
const client = instance.decorateEmitToPassProxyToken(login.getClient());
|
|
41
|
+
yield this.assertProxyEquals(client, id);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
static canSetTokenWhileDecorating() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const instance = this.getDecorator();
|
|
47
|
+
const client = instance.decorateEmitToPassProxyToken(login.getClient(), '123');
|
|
48
|
+
yield this.assertProxyEquals(client, '123');
|
|
49
|
+
this.lastInstance = this.getDecorator();
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
static decoratorPassProps() {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const client = login.getClient();
|
|
55
|
+
this.assertPropsCopied(client, 'auth', { skill: true });
|
|
56
|
+
this.assertPropsCopied(client, 'hell', { world: 'there' });
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
static assertPropsCopied(client, key, props) {
|
|
60
|
+
const instance = this.getDecorator();
|
|
61
|
+
client[key] = props;
|
|
62
|
+
const decorated = instance.decorateEmitToPassProxyToken(client);
|
|
63
|
+
//@ts-ignore
|
|
64
|
+
assert.isEqualDeep(decorated[key], props);
|
|
65
|
+
}
|
|
66
|
+
static instanceIsSameEachTest() {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
assert.isEqual(this.lastInstance, this.getDecorator());
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
static loginSetsUpProxyTokenGenerator() {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const generator = this.getDecorator().getProxyTokenGenerator();
|
|
74
|
+
assert.isTruthy(generator);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
static assertProxyEquals(client, id) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
let passedSource;
|
|
80
|
+
yield client.on('whoami::v2020_12_25', ({ source }) => {
|
|
81
|
+
passedSource = source;
|
|
82
|
+
return {
|
|
83
|
+
type: 'anonymous',
|
|
84
|
+
auth: {},
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
yield client.emit('whoami::v2020_12_25');
|
|
88
|
+
assert.isEqual(passedSource.proxyToken, id);
|
|
89
|
+
yield client.emitAndFlattenResponses('whoami::v2020_12_25');
|
|
90
|
+
assert.isEqual(passedSource.proxyToken, id);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
static getDecorator() {
|
|
94
|
+
return ClientProxyDecorator.getInstance();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
__decorate([
|
|
98
|
+
test()
|
|
99
|
+
], DecoratingEmitToPassThroughProxyTest, "sharesInstance", null);
|
|
100
|
+
__decorate([
|
|
101
|
+
test()
|
|
102
|
+
], DecoratingEmitToPassThroughProxyTest, "canClearInstance", null);
|
|
103
|
+
__decorate([
|
|
104
|
+
test()
|
|
105
|
+
], DecoratingEmitToPassThroughProxyTest, "canGetAndSetProxyGenerator", null);
|
|
106
|
+
__decorate([
|
|
107
|
+
test('can set token to 234', '234'),
|
|
108
|
+
test('can set token to waka', 'waka')
|
|
109
|
+
], DecoratingEmitToPassThroughProxyTest, "canSetDefaultProxyPassThrough", null);
|
|
110
|
+
__decorate([
|
|
111
|
+
test()
|
|
112
|
+
], DecoratingEmitToPassThroughProxyTest, "canSetTokenWhileDecorating", null);
|
|
113
|
+
__decorate([
|
|
114
|
+
test()
|
|
115
|
+
], DecoratingEmitToPassThroughProxyTest, "decoratorPassProps", null);
|
|
116
|
+
__decorate([
|
|
117
|
+
test()
|
|
118
|
+
], DecoratingEmitToPassThroughProxyTest, "instanceIsSameEachTest", null);
|
|
119
|
+
__decorate([
|
|
120
|
+
test()
|
|
121
|
+
], DecoratingEmitToPassThroughProxyTest, "loginSetsUpProxyTokenGenerator", null);
|
|
122
|
+
DecoratingEmitToPassThroughProxyTest = __decorate([
|
|
123
|
+
login(DEMO_NUMBER)
|
|
124
|
+
], DecoratingEmitToPassThroughProxyTest);
|
|
125
|
+
export default DecoratingEmitToPassThroughProxyTest;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { MercuryTestClient } from '@sprucelabs/mercury-client';
|
|
17
|
+
import { assert, test } from '@sprucelabs/test';
|
|
18
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
|
19
|
+
import { DEMO_NUMBER } from '../../tests/constants.js';
|
|
20
|
+
import fake from '../../tests/decorators/fake.js';
|
|
21
|
+
process.env.SKILL_ID = 'yay';
|
|
22
|
+
process.env.SKILL_API_KEY = 'yay';
|
|
23
|
+
let DelaysConnectWhenOnlyUsingLoginDecoratorTest = class DelaysConnectWhenOnlyUsingLoginDecoratorTest extends AbstractSpruceFixtureTest {
|
|
24
|
+
static globalEmitterListeningToAuthenticate() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const emitter = MercuryTestClient.getInternalEmitter({
|
|
27
|
+
eventSignatures: {},
|
|
28
|
+
});
|
|
29
|
+
//@ts-ignore
|
|
30
|
+
assert.isTruthy(emitter.listenersByEvent['authenticate::v2020_12_25']);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
__decorate([
|
|
35
|
+
test()
|
|
36
|
+
], DelaysConnectWhenOnlyUsingLoginDecoratorTest, "globalEmitterListeningToAuthenticate", null);
|
|
37
|
+
DelaysConnectWhenOnlyUsingLoginDecoratorTest = __decorate([
|
|
38
|
+
fake.login(DEMO_NUMBER)
|
|
39
|
+
], DelaysConnectWhenOnlyUsingLoginDecoratorTest);
|
|
40
|
+
export default DelaysConnectWhenOnlyUsingLoginDecoratorTest;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { test, assert } from '@sprucelabs/test';
|
|
8
|
+
import { AbstractSpruceFixtureTest } from '../../index.js';
|
|
9
|
+
export default class DisablingSchemaValidationOnTestTest extends AbstractSpruceFixtureTest {
|
|
10
|
+
static shouldValidateIsFalse() {
|
|
11
|
+
assert.isEqual(process.env.SHOULD_VALIDATE_SCHEMAS_ON_BOOT, 'false');
|
|
12
|
+
process.env.SHOULD_VALIDATE_SCHEMAS_ON_BOOT = 'true';
|
|
13
|
+
}
|
|
14
|
+
static revertsBeforeEachTest() {
|
|
15
|
+
assert.isEqual(process.env.SHOULD_VALIDATE_SCHEMAS_ON_BOOT, 'false');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
test()
|
|
20
|
+
], DisablingSchemaValidationOnTestTest, "shouldValidateIsFalse", null);
|
|
21
|
+
__decorate([
|
|
22
|
+
test()
|
|
23
|
+
], DisablingSchemaValidationOnTestTest, "revertsBeforeEachTest", null);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
|
2
|
+
export default class DoesntResetAccountIfOnlySeedingLocally extends AbstractSpruceFixtureTest {
|
|
3
|
+
protected static beforeEach(): Promise<void>;
|
|
4
|
+
protected static doesNotResetAccount(): void;
|
|
5
|
+
protected static doesNotResetBefore(): Promise<void>;
|
|
6
|
+
protected static resetAfterSeedingOrgs(): void;
|
|
7
|
+
protected static shouldNotHaveHit(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { MercuryTestClient } from '@sprucelabs/mercury-client';
|
|
17
|
+
import { coreEventContracts } from '@sprucelabs/mercury-core-events';
|
|
18
|
+
import { assert, test } from '@sprucelabs/test';
|
|
19
|
+
import { login, seed, StoreFixture } from '../../index.js';
|
|
20
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
|
21
|
+
import { DEMO_NUMBER_ACCOUNT_RESET } from '../../tests/constants.js';
|
|
22
|
+
// eslint-disable-next-line spruce/prohibit-import-from-build-folder
|
|
23
|
+
import GoodStore from '../testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js';
|
|
24
|
+
let hitCount = 0;
|
|
25
|
+
MercuryTestClient.reset = () => { };
|
|
26
|
+
//@ts-ignore
|
|
27
|
+
const emitter = MercuryTestClient.getInternalEmitter(coreEventContracts[0]);
|
|
28
|
+
void emitter.on('list-organizations::v2020_12_25', () => {
|
|
29
|
+
hitCount++;
|
|
30
|
+
return {
|
|
31
|
+
organizations: [],
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
let DoesntResetAccountIfOnlySeedingLocally = class DoesntResetAccountIfOnlySeedingLocally extends AbstractSpruceFixtureTest {
|
|
35
|
+
static beforeEach() {
|
|
36
|
+
const _super = Object.create(null, {
|
|
37
|
+
beforeEach: { get: () => super.beforeEach }
|
|
38
|
+
});
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
yield _super.beforeEach.call(this);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
static doesNotResetAccount() {
|
|
44
|
+
assert.isEqual(hitCount, 1);
|
|
45
|
+
}
|
|
46
|
+
static doesNotResetBefore() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
assert.isEqual(hitCount, 1);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
static resetAfterSeedingOrgs() {
|
|
52
|
+
assert.isEqual(hitCount, 2);
|
|
53
|
+
}
|
|
54
|
+
static shouldNotHaveHit() {
|
|
55
|
+
assert.isEqual(hitCount, 2);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
__decorate([
|
|
59
|
+
test(),
|
|
60
|
+
seed('good', 5)
|
|
61
|
+
], DoesntResetAccountIfOnlySeedingLocally, "doesNotResetAccount", null);
|
|
62
|
+
__decorate([
|
|
63
|
+
test(),
|
|
64
|
+
seed('organizations', 1)
|
|
65
|
+
], DoesntResetAccountIfOnlySeedingLocally, "doesNotResetBefore", null);
|
|
66
|
+
__decorate([
|
|
67
|
+
test()
|
|
68
|
+
], DoesntResetAccountIfOnlySeedingLocally, "resetAfterSeedingOrgs", null);
|
|
69
|
+
__decorate([
|
|
70
|
+
test()
|
|
71
|
+
], DoesntResetAccountIfOnlySeedingLocally, "shouldNotHaveHit", null);
|
|
72
|
+
DoesntResetAccountIfOnlySeedingLocally = __decorate([
|
|
73
|
+
login(DEMO_NUMBER_ACCOUNT_RESET)
|
|
74
|
+
], DoesntResetAccountIfOnlySeedingLocally);
|
|
75
|
+
export default DoesntResetAccountIfOnlySeedingLocally;
|
|
76
|
+
StoreFixture.setStore('good', GoodStore);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AbstractStore } from '@sprucelabs/data-stores';
|
|
2
|
+
import { SpruceSchemas } from '@sprucelabs/mercury-types';
|
|
3
|
+
import { StoreSeedOptions } from '../../types/store.types';
|
|
4
|
+
declare const dummySchema: {
|
|
5
|
+
id: string;
|
|
6
|
+
fields: {
|
|
7
|
+
id: {
|
|
8
|
+
type: "id";
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
declare type DummySchema = typeof dummySchema;
|
|
13
|
+
export declare class DummyStore extends AbstractStore<DummySchema> {
|
|
14
|
+
name: string;
|
|
15
|
+
protected collectionName: string;
|
|
16
|
+
protected createSchema: {
|
|
17
|
+
id: string;
|
|
18
|
+
fields: {
|
|
19
|
+
id: {
|
|
20
|
+
type: "id";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
protected updateSchema: {
|
|
25
|
+
id: string;
|
|
26
|
+
fields: {
|
|
27
|
+
id: {
|
|
28
|
+
type: "id";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
protected fullSchema: {
|
|
33
|
+
id: string;
|
|
34
|
+
fields: {
|
|
35
|
+
id: {
|
|
36
|
+
type: "id";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
protected databaseSchema: {
|
|
41
|
+
id: string;
|
|
42
|
+
fields: {
|
|
43
|
+
id: {
|
|
44
|
+
type: "id";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
static lastFakedOwner?: SpruceSchemas.Spruce.v2020_07_22.Person;
|
|
49
|
+
static seedCb?: () => Promise<void> | void;
|
|
50
|
+
static wasSeedInvoked: boolean;
|
|
51
|
+
static seedOptions: {};
|
|
52
|
+
static Store(options: any): DummyStore;
|
|
53
|
+
seed(options: StoreSeedOptions): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { AbstractStore } from '@sprucelabs/data-stores';
|
|
11
|
+
import { buildSchema } from '@sprucelabs/schema';
|
|
12
|
+
const dummySchema = buildSchema({
|
|
13
|
+
id: 'dummy',
|
|
14
|
+
fields: {
|
|
15
|
+
id: {
|
|
16
|
+
type: 'id',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export class DummyStore extends AbstractStore {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.name = 'Dummy!';
|
|
24
|
+
this.collectionName = 'dummies';
|
|
25
|
+
this.createSchema = dummySchema;
|
|
26
|
+
this.updateSchema = dummySchema;
|
|
27
|
+
this.fullSchema = dummySchema;
|
|
28
|
+
this.databaseSchema = dummySchema;
|
|
29
|
+
}
|
|
30
|
+
static Store(options) {
|
|
31
|
+
return new this(options);
|
|
32
|
+
}
|
|
33
|
+
seed(options) {
|
|
34
|
+
var _a;
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
DummyStore.wasSeedInvoked = true;
|
|
37
|
+
DummyStore.seedOptions = options;
|
|
38
|
+
yield ((_a = DummyStore.seedCb) === null || _a === void 0 ? void 0 : _a.call(DummyStore));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
DummyStore.wasSeedInvoked = false;
|
|
43
|
+
DummyStore.seedOptions = {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbstractSpruceFixtureTest } from '../..';
|
|
2
|
+
export default class FakingErrorResponsesTest extends AbstractSpruceFixtureTest {
|
|
3
|
+
private static client;
|
|
4
|
+
protected static beforeEach(): Promise<void>;
|
|
5
|
+
protected static throwsWhenFakingResponse(fqen: any, targetAndPayload: any): Promise<void>;
|
|
6
|
+
protected static onClearsPreviousListeners(fqen: any): Promise<void>;
|
|
7
|
+
protected static throwsEvenWhenFakingWithPreviousListeners(): Promise<void>;
|
|
8
|
+
protected static fakeEventsAreClearedFromPreviousTest(): Promise<void>;
|
|
9
|
+
protected static canFakeEventWithNoResponse(): Promise<void>;
|
|
10
|
+
protected static canCustomizeTheErrorPassedIn(): Promise<void>;
|
|
11
|
+
private static assertResponseIsFakeEventError;
|
|
12
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { eventAssertUtil } from '@sprucelabs/spruce-event-utils';
|
|
17
|
+
import { test, assert } from '@sprucelabs/test';
|
|
18
|
+
import { AbstractSpruceFixtureTest } from '../../index.js';
|
|
19
|
+
import SpruceError from '../../errors/SpruceError.js';
|
|
20
|
+
import eventFaker from '../../tests/eventFaker.js';
|
|
21
|
+
export default class FakingErrorResponsesTest extends AbstractSpruceFixtureTest {
|
|
22
|
+
static beforeEach() {
|
|
23
|
+
const _super = Object.create(null, {
|
|
24
|
+
beforeEach: { get: () => super.beforeEach }
|
|
25
|
+
});
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
yield _super.beforeEach.call(this);
|
|
28
|
+
this.client = (yield this.mercury.connectToApi());
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
static throwsWhenFakingResponse(fqen, targetAndPayload) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
yield eventFaker.makeEventThrow(fqen);
|
|
34
|
+
yield this.assertResponseIsFakeEventError(fqen, targetAndPayload);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
static onClearsPreviousListeners(fqen) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
let wasOldHit = false;
|
|
40
|
+
let wasNewHit = false;
|
|
41
|
+
if (!this.client.doesHandleEvent(fqen)) {
|
|
42
|
+
this.client.mixinContract({
|
|
43
|
+
eventSignatures: {
|
|
44
|
+
[fqen]: {},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
yield this.client.on(fqen, () => {
|
|
49
|
+
wasOldHit = true;
|
|
50
|
+
});
|
|
51
|
+
yield eventFaker.on(fqen, () => {
|
|
52
|
+
wasNewHit = true;
|
|
53
|
+
return {
|
|
54
|
+
auth: {},
|
|
55
|
+
type: 'anonymous',
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
assert.isFalse(wasNewHit);
|
|
59
|
+
yield this.client.emit(fqen);
|
|
60
|
+
assert.isFalse(wasOldHit);
|
|
61
|
+
assert.isTrue(wasNewHit);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
static throwsEvenWhenFakingWithPreviousListeners() {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
//@ts-ignore
|
|
67
|
+
yield this.client.on('whoami::v2020_12_25', () => __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return {};
|
|
69
|
+
}));
|
|
70
|
+
yield eventFaker.makeEventThrow('whoami::v2020_12_25');
|
|
71
|
+
yield this.assertResponseIsFakeEventError('whoami::v2020_12_25');
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
static fakeEventsAreClearedFromPreviousTest() {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
yield this.client.on('request-pin::v2020_12_25', () => __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
return {
|
|
78
|
+
challenge: 'aoeu',
|
|
79
|
+
};
|
|
80
|
+
}));
|
|
81
|
+
yield this.client.emitAndFlattenResponses('request-pin::v2020_12_25', {
|
|
82
|
+
payload: {
|
|
83
|
+
phone: '+555-000-0001',
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
static canFakeEventWithNoResponse() {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const fqen = 'test-burrito::v1';
|
|
91
|
+
this.client.mixinContract({
|
|
92
|
+
eventSignatures: {
|
|
93
|
+
[fqen]: {
|
|
94
|
+
isGlobal: true,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
yield eventFaker.handleReactiveEvent(fqen);
|
|
99
|
+
const results = yield this.client.emit(fqen);
|
|
100
|
+
assert.isEqual(results.totalErrors, 0);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
static canCustomizeTheErrorPassedIn() {
|
|
104
|
+
var _a;
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const error = new SpruceError({
|
|
107
|
+
code: 'INVALID_TARGET',
|
|
108
|
+
});
|
|
109
|
+
yield eventFaker.makeEventThrow('whoami::v2020_12_25', error);
|
|
110
|
+
const results = yield this.client.emit('whoami::v2020_12_25');
|
|
111
|
+
assert.isEqualDeep((_a = results.responses[0].errors) === null || _a === void 0 ? void 0 : _a[0], error);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
static assertResponseIsFakeEventError(fqen, targetAndPayload) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
const results = yield this.client.emit(fqen, targetAndPayload);
|
|
117
|
+
assert.isEqual(results.totalErrors, 1);
|
|
118
|
+
eventAssertUtil.assertErrorFromResponse(results, 'FAKE_EVENT_ERROR', {
|
|
119
|
+
fqen,
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
__decorate([
|
|
125
|
+
test('faking whoami::v2020_12_25', 'whoami::v2020_12_25'),
|
|
126
|
+
test('faking request-pin::v2020_12_25', 'request-pin::v2020_12_25', {
|
|
127
|
+
payload: {
|
|
128
|
+
phone: '+555-000-0001',
|
|
129
|
+
},
|
|
130
|
+
})
|
|
131
|
+
], FakingErrorResponsesTest, "throwsWhenFakingResponse", null);
|
|
132
|
+
__decorate([
|
|
133
|
+
test('on clears previous listeners 1', 'whoami::v2020_12_25'),
|
|
134
|
+
test('on clears previous listeners 2', 'what-the::v2020_12_25')
|
|
135
|
+
], FakingErrorResponsesTest, "onClearsPreviousListeners", null);
|
|
136
|
+
__decorate([
|
|
137
|
+
test()
|
|
138
|
+
], FakingErrorResponsesTest, "throwsEvenWhenFakingWithPreviousListeners", null);
|
|
139
|
+
__decorate([
|
|
140
|
+
test()
|
|
141
|
+
], FakingErrorResponsesTest, "fakeEventsAreClearedFromPreviousTest", null);
|
|
142
|
+
__decorate([
|
|
143
|
+
test()
|
|
144
|
+
], FakingErrorResponsesTest, "canFakeEventWithNoResponse", null);
|
|
145
|
+
__decorate([
|
|
146
|
+
test()
|
|
147
|
+
], FakingErrorResponsesTest, "canCustomizeTheErrorPassedIn", null);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import AbstractSpruceTest from '@sprucelabs/test';
|
|
2
|
+
export default class FixtureFactoryTest extends AbstractSpruceTest {
|
|
3
|
+
protected static throwsWithBadFixture(): void;
|
|
4
|
+
protected static getsFixture(name: string, Class: any): void;
|
|
5
|
+
private static Fixture;
|
|
6
|
+
protected static destroyDisconnectsClient(): Promise<void>;
|
|
7
|
+
}
|