@sprucelabs/spruce-test-fixtures 60.1.158 → 60.1.160
Sign up to get free protection for your applications and to get access to all the features.
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +1 -1
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +9 -6
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +9 -5
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +1 -1
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +8 -5
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +1 -1
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +10 -4
- package/build/__tests__/behavioral/MercuryFixture.test.d.ts +1 -0
- package/build/__tests__/behavioral/MercuryFixture.test.js +6 -0
- package/build/__tests__/behavioral/PersonFixture.test.js +1 -0
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +1 -1
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +11 -4
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +1 -1
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +11 -4
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +1 -1
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +11 -4
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +1 -1
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +12 -5
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +7 -4
- package/build/__tests__/behavioral/SkillFixture.test.js +4 -2
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +1 -0
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +2 -0
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +4 -1
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +5 -1
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +4 -1
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +4 -1
- package/build/esm/__tests__/behavioral/MercuryFixture.test.d.ts +1 -0
- package/build/esm/__tests__/behavioral/MercuryFixture.test.js +9 -1
- package/build/esm/__tests__/behavioral/PersonFixture.test.js +1 -0
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +5 -1
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +5 -1
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +5 -1
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +5 -1
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +4 -1
- package/build/esm/__tests__/behavioral/SkillFixture.test.js +3 -1
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +1 -0
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +2 -0
- package/build/esm/tests/fixtures/MercuryFixture.d.ts +2 -0
- package/build/esm/tests/fixtures/MercuryFixture.js +6 -0
- package/build/tests/fixtures/MercuryFixture.d.ts +2 -0
- package/build/tests/fixtures/MercuryFixture.js +6 -0
- package/package.json +17 -17
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class DecoratingEmitToPassThroughProxyTest extends AbstractSpruceFixtureTest {
|
3
3
|
private static lastInstance;
|
4
4
|
protected static sharesInstance(): void;
|
@@ -10,10 +10,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
13
|
-
const __1 = require("../..");
|
14
13
|
const ClientProxyDecorator_1 = __importDefault(require("../../ClientProxyDecorator"));
|
14
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
15
15
|
const constants_1 = require("../../tests/constants");
|
16
|
-
|
16
|
+
const login_1 = __importDefault(require("../../tests/decorators/login"));
|
17
|
+
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
18
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
19
|
+
let DecoratingEmitToPassThroughProxyTest = class DecoratingEmitToPassThroughProxyTest extends AbstractSpruceFixtureTest_1.default {
|
17
20
|
static sharesInstance() {
|
18
21
|
const instance = this.getDecorator();
|
19
22
|
test_utils_1.assert.isEqual(instance, ClientProxyDecorator_1.default.getInstance());
|
@@ -32,17 +35,17 @@ let DecoratingEmitToPassThroughProxyTest = class DecoratingEmitToPassThroughProx
|
|
32
35
|
static async canSetDefaultProxyPassThrough(id) {
|
33
36
|
const instance = this.getDecorator();
|
34
37
|
instance.setProxyTokenGenerator(async () => id);
|
35
|
-
const client = instance.decorateEmitToPassProxyToken(
|
38
|
+
const client = instance.decorateEmitToPassProxyToken(login_1.default.getClient());
|
36
39
|
await this.assertProxyEquals(client, id);
|
37
40
|
}
|
38
41
|
static async canSetTokenWhileDecorating() {
|
39
42
|
const instance = this.getDecorator();
|
40
|
-
const client = instance.decorateEmitToPassProxyToken(
|
43
|
+
const client = instance.decorateEmitToPassProxyToken(login_1.default.getClient(), '123');
|
41
44
|
await this.assertProxyEquals(client, '123');
|
42
45
|
this.lastInstance = this.getDecorator();
|
43
46
|
}
|
44
47
|
static async decoratorPassProps() {
|
45
|
-
const client =
|
48
|
+
const client = login_1.default.getClient();
|
46
49
|
this.assertPropsCopied(client, 'auth', { skill: true });
|
47
50
|
this.assertPropsCopied(client, 'hell', { world: 'there' });
|
48
51
|
}
|
@@ -104,6 +107,6 @@ __decorate([
|
|
104
107
|
(0, test_utils_1.test)()
|
105
108
|
], DecoratingEmitToPassThroughProxyTest, "loginSetsUpProxyTokenGenerator", null);
|
106
109
|
DecoratingEmitToPassThroughProxyTest = __decorate([
|
107
|
-
(0,
|
110
|
+
(0, login_1.default)(constants_1.DEMO_NUMBER)
|
108
111
|
], DecoratingEmitToPassThroughProxyTest);
|
109
112
|
exports.default = DecoratingEmitToPassThroughProxyTest;
|
@@ -12,11 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const mercury_client_1 = require("@sprucelabs/mercury-client");
|
13
13
|
const mercury_core_events_1 = require("@sprucelabs/mercury-core-events");
|
14
14
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
15
|
-
const __1 = require("../..");
|
16
15
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
17
16
|
const constants_1 = require("../../tests/constants");
|
17
|
+
const login_1 = __importDefault(require("../../tests/decorators/login"));
|
18
|
+
const seed_1 = __importDefault(require("../../tests/decorators/seed"));
|
19
|
+
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
20
|
+
const StoreFixture_1 = __importDefault(require("../../tests/fixtures/StoreFixture"));
|
18
21
|
// eslint-disable-next-line spruce/prohibit-import-from-build-folder
|
19
22
|
const Good_store_1 = __importDefault(require("../testDirsAndFiles/one-good-store-skill/build/stores/Good.store"));
|
23
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
20
24
|
let hitCount = 0;
|
21
25
|
mercury_client_1.MercuryTestClient.reset = () => { };
|
22
26
|
//@ts-ignore
|
@@ -46,11 +50,11 @@ let DoesntResetAccountIfOnlySeedingLocally = class DoesntResetAccountIfOnlySeedi
|
|
46
50
|
};
|
47
51
|
__decorate([
|
48
52
|
(0, test_utils_1.test)(),
|
49
|
-
(0,
|
53
|
+
(0, seed_1.default)('good', 5)
|
50
54
|
], DoesntResetAccountIfOnlySeedingLocally, "doesNotResetAccount", null);
|
51
55
|
__decorate([
|
52
56
|
(0, test_utils_1.test)(),
|
53
|
-
(0,
|
57
|
+
(0, seed_1.default)('organizations', 1)
|
54
58
|
], DoesntResetAccountIfOnlySeedingLocally, "doesNotResetBefore", null);
|
55
59
|
__decorate([
|
56
60
|
(0, test_utils_1.test)()
|
@@ -59,7 +63,7 @@ __decorate([
|
|
59
63
|
(0, test_utils_1.test)()
|
60
64
|
], DoesntResetAccountIfOnlySeedingLocally, "shouldNotHaveHit", null);
|
61
65
|
DoesntResetAccountIfOnlySeedingLocally = __decorate([
|
62
|
-
(0,
|
66
|
+
(0, login_1.default)(constants_1.DEMO_NUMBER_ACCOUNT_RESET)
|
63
67
|
], DoesntResetAccountIfOnlySeedingLocally);
|
64
68
|
exports.default = DoesntResetAccountIfOnlySeedingLocally;
|
65
|
-
|
69
|
+
StoreFixture_1.default.setStore('good', Good_store_1.default);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class LoginDecoratorHandlingProxiesForMeTest extends AbstractSpruceFixtureTest {
|
3
3
|
private static lastToken?;
|
4
4
|
protected static proxyTokenGeneratorReturnsExpectedProxyToken(expected: string): Promise<void>;
|
@@ -11,12 +11,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
13
13
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
14
|
-
const __1 = require("../..");
|
15
14
|
const ClientProxyDecorator_1 = __importDefault(require("../../ClientProxyDecorator"));
|
15
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
16
16
|
const constants_1 = require("../../tests/constants");
|
17
|
-
|
17
|
+
const login_1 = __importDefault(require("../../tests/decorators/login"));
|
18
|
+
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
19
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
20
|
+
let LoginDecoratorHandlingProxiesForMeTest = class LoginDecoratorHandlingProxiesForMeTest extends AbstractSpruceFixtureTest_1.default {
|
18
21
|
static async proxyTokenGeneratorReturnsExpectedProxyToken(expected) {
|
19
|
-
await
|
22
|
+
await login_1.default.getClient().on('register-proxy-token::v2020_12_25', () => {
|
20
23
|
return {
|
21
24
|
token: expected,
|
22
25
|
};
|
@@ -26,7 +29,7 @@ let LoginDecoratorHandlingProxiesForMeTest = class LoginDecoratorHandlingProxies
|
|
26
29
|
}
|
27
30
|
static async onlyEmitsEventOnce() {
|
28
31
|
let hitCount = 0;
|
29
|
-
await
|
32
|
+
await login_1.default.getClient().on('register-proxy-token::v2020_12_25', () => {
|
30
33
|
hitCount++;
|
31
34
|
return {
|
32
35
|
token: 'aoeu',
|
@@ -87,6 +90,6 @@ __decorate([
|
|
87
90
|
(0, test_utils_1.test)()
|
88
91
|
], LoginDecoratorHandlingProxiesForMeTest, "loggingAnAsDemoPerson2AgainSetsValidProxy", null);
|
89
92
|
LoginDecoratorHandlingProxiesForMeTest = __decorate([
|
90
|
-
(0,
|
93
|
+
(0, login_1.default)(constants_1.DEMO_NUMBER_LOGIN_DECORATOR)
|
91
94
|
], LoginDecoratorHandlingProxiesForMeTest);
|
92
95
|
exports.default = LoginDecoratorHandlingProxiesForMeTest;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class MakingSureLocalEventsAreHandledLocallyTest extends AbstractSpruceFixtureTest {
|
3
3
|
protected static throwsWhenNoListenerSetForLocalEvent(): Promise<void>;
|
4
4
|
}
|
@@ -5,18 +5,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
7
|
};
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
10
|
+
};
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
9
12
|
const mercury_client_1 = require("@sprucelabs/mercury-client");
|
10
13
|
const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
|
11
14
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
12
|
-
const
|
15
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
13
16
|
const constants_1 = require("../../tests/constants");
|
14
|
-
|
17
|
+
const login_1 = __importDefault(require("../../tests/decorators/login"));
|
18
|
+
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
19
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
20
|
+
let MakingSureLocalEventsAreHandledLocallyTest = class MakingSureLocalEventsAreHandledLocallyTest extends AbstractSpruceFixtureTest_1.default {
|
15
21
|
static async throwsWhenNoListenerSetForLocalEvent() {
|
16
22
|
await this.SkillFromTestDir('skill');
|
17
23
|
const skill = await this.skills.seedDemoSkill();
|
18
24
|
spruce_skill_utils_1.AuthService.Auth(this.cwd).updateCurrentSkill(skill);
|
19
|
-
await
|
25
|
+
await MercuryFixture_1.default.beforeEach(this.cwd);
|
20
26
|
test_utils_1.assert.isEqualDeep(mercury_client_1.MercuryTestClient.getNamespacesThatMustBeHandledLocally(), [skill.slug]);
|
21
27
|
}
|
22
28
|
};
|
@@ -24,6 +30,6 @@ __decorate([
|
|
24
30
|
(0, test_utils_1.test)()
|
25
31
|
], MakingSureLocalEventsAreHandledLocallyTest, "throwsWhenNoListenerSetForLocalEvent", null);
|
26
32
|
MakingSureLocalEventsAreHandledLocallyTest = __decorate([
|
27
|
-
(0,
|
33
|
+
(0, login_1.default)(constants_1.DEMO_NUMBER_HANDLING_EVENTS_LOCALLY)
|
28
34
|
], MakingSureLocalEventsAreHandledLocallyTest);
|
29
35
|
exports.default = MakingSureLocalEventsAreHandledLocallyTest;
|
@@ -14,6 +14,7 @@ export default class MercuryFixtureTest extends AbstractSpruceFixtureTest {
|
|
14
14
|
protected static allClientsGoingForwardUseThatClient(): Promise<void>;
|
15
15
|
protected static resetsDefaultClientBeforeEach(): Promise<void>;
|
16
16
|
protected static canForceNewClient(): Promise<void>;
|
17
|
+
protected static setsRequiresLocalListenersByDefault(): Promise<void>;
|
17
18
|
private static connectToApi;
|
18
19
|
private static createDirWriteContractFileAndSetCwd;
|
19
20
|
}
|
@@ -114,6 +114,9 @@ class MercuryFixtureTest extends AbstractSpruceFixtureTest_1.default {
|
|
114
114
|
});
|
115
115
|
test_utils_1.assert.isNotEqual(client, client2);
|
116
116
|
}
|
117
|
+
static async setsRequiresLocalListenersByDefault() {
|
118
|
+
test_utils_1.assert.isTrue(mercury_client_1.MercuryTestClient.getShouldRequireLocalListeners());
|
119
|
+
}
|
117
120
|
static async connectToApi(options) {
|
118
121
|
return await new FixtureFactory_1.default({ cwd: this.cwd })
|
119
122
|
.Fixture('mercury')
|
@@ -179,3 +182,6 @@ __decorate([
|
|
179
182
|
__decorate([
|
180
183
|
(0, test_utils_1.test)()
|
181
184
|
], MercuryFixtureTest, "canForceNewClient", null);
|
185
|
+
__decorate([
|
186
|
+
(0, test_utils_1.test)()
|
187
|
+
], MercuryFixtureTest, "setsRequiresLocalListenersByDefault", null);
|
@@ -41,6 +41,7 @@ const __1 = require("../..");
|
|
41
41
|
const constants_1 = require("../../tests/constants");
|
42
42
|
const FixtureFactory_1 = __importDefault(require("../../tests/fixtures/FixtureFactory"));
|
43
43
|
dotenv_1.default.config();
|
44
|
+
__1.MercuryFixture.setShouldRequireLocalListeners(false);
|
44
45
|
class PersonFixtureTest extends test_utils_1.default {
|
45
46
|
static async beforeEach() {
|
46
47
|
await super.beforeEach();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class ResettingAccountBeforeAllTestsTest extends AbstractSpruceFixtureTest {
|
3
3
|
protected static beforeAll(): Promise<void>;
|
4
4
|
protected static delayToGivesSeederTimeToWrite(): Promise<void>;
|
@@ -5,12 +5,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
7
|
};
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
10
|
+
};
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
9
12
|
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
10
13
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
11
|
-
const
|
14
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
12
15
|
const constants_1 = require("../../tests/constants");
|
13
|
-
|
16
|
+
const login_1 = __importDefault(require("../../tests/decorators/login"));
|
17
|
+
const seed_1 = __importDefault(require("../../tests/decorators/seed"));
|
18
|
+
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
19
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
20
|
+
let ResettingAccountBeforeAllTestsTest = class ResettingAccountBeforeAllTestsTest extends AbstractSpruceFixtureTest_1.default {
|
14
21
|
static async beforeAll() {
|
15
22
|
await super.beforeAll();
|
16
23
|
const { client } = await this.people.loginAsDemoPerson(constants_1.DEMO_NUMBER_ACCOUNT_BEFORE_ALL_RESET_LOCATION);
|
@@ -50,10 +57,10 @@ __decorate([
|
|
50
57
|
], ResettingAccountBeforeAllTestsTest, "shouldHaveNoLocations", null);
|
51
58
|
__decorate([
|
52
59
|
(0, test_utils_1.test)(),
|
53
|
-
(0,
|
60
|
+
(0, seed_1.default)('locations', 1)
|
54
61
|
], ResettingAccountBeforeAllTestsTest, "nothing", null);
|
55
62
|
ResettingAccountBeforeAllTestsTest = __decorate([
|
56
|
-
(0,
|
63
|
+
(0, login_1.default)(constants_1.DEMO_NUMBER_ACCOUNT_BEFORE_ALL_RESET_LOCATION)
|
57
64
|
], ResettingAccountBeforeAllTestsTest);
|
58
65
|
exports.default = ResettingAccountBeforeAllTestsTest;
|
59
66
|
//@ts-ignore
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class ResettingAccountAfterAllTestsTest extends AbstractSpruceFixtureTest {
|
3
3
|
protected static afterAll(): Promise<void>;
|
4
4
|
protected static seedMoar(): Promise<void>;
|
@@ -5,11 +5,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
7
|
};
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
10
|
+
};
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
9
12
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
10
|
-
const
|
13
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
11
14
|
const constants_1 = require("../../tests/constants");
|
12
|
-
|
15
|
+
const login_1 = __importDefault(require("../../tests/decorators/login"));
|
16
|
+
const seed_1 = __importDefault(require("../../tests/decorators/seed"));
|
17
|
+
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
18
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
19
|
+
let ResettingAccountAfterAllTestsTest = class ResettingAccountAfterAllTestsTest extends AbstractSpruceFixtureTest_1.default {
|
13
20
|
static async afterAll() {
|
14
21
|
await super.afterAll();
|
15
22
|
const orgs = await this.organizations.listOrganizations(constants_1.DEMO_NUMBER_ACCOUNT_AFTER_ALL_RESET);
|
@@ -23,10 +30,10 @@ let ResettingAccountAfterAllTestsTest = class ResettingAccountAfterAllTestsTest
|
|
23
30
|
};
|
24
31
|
__decorate([
|
25
32
|
(0, test_utils_1.test)(),
|
26
|
-
(0,
|
33
|
+
(0, seed_1.default)('organizations', 1)
|
27
34
|
], ResettingAccountAfterAllTestsTest, "seedMoar", null);
|
28
35
|
ResettingAccountAfterAllTestsTest = __decorate([
|
29
|
-
(0,
|
36
|
+
(0, login_1.default)(constants_1.DEMO_NUMBER_ACCOUNT_AFTER_ALL_RESET)
|
30
37
|
], ResettingAccountAfterAllTestsTest);
|
31
38
|
exports.default = ResettingAccountAfterAllTestsTest;
|
32
39
|
//@ts-ignore
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class ResettingAccountBeforeAllTestsTest extends AbstractSpruceFixtureTest {
|
3
3
|
protected static beforeAll(): Promise<void>;
|
4
4
|
protected static delayToGivesSeederTimeToWrite(): Promise<void>;
|
@@ -5,11 +5,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
7
|
};
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
10
|
+
};
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
9
12
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
10
|
-
const
|
13
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
11
14
|
const constants_1 = require("../../tests/constants");
|
12
|
-
|
15
|
+
const login_1 = __importDefault(require("../../tests/decorators/login"));
|
16
|
+
const seed_1 = __importDefault(require("../../tests/decorators/seed"));
|
17
|
+
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
18
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
19
|
+
let ResettingAccountBeforeAllTestsTest = class ResettingAccountBeforeAllTestsTest extends AbstractSpruceFixtureTest_1.default {
|
13
20
|
static async beforeAll() {
|
14
21
|
await this.wait(5000);
|
15
22
|
await super.beforeAll();
|
@@ -34,10 +41,10 @@ __decorate([
|
|
34
41
|
], ResettingAccountBeforeAllTestsTest, "shouldHaveNoOrgs", null);
|
35
42
|
__decorate([
|
36
43
|
(0, test_utils_1.test)(),
|
37
|
-
(0,
|
44
|
+
(0, seed_1.default)('organizations', 1)
|
38
45
|
], ResettingAccountBeforeAllTestsTest, "nothing", null);
|
39
46
|
ResettingAccountBeforeAllTestsTest = __decorate([
|
40
|
-
(0,
|
47
|
+
(0, login_1.default)(constants_1.DEMO_NUMBER_ACCOUNT_BEFORE_ALL_RESET)
|
41
48
|
], ResettingAccountBeforeAllTestsTest);
|
42
49
|
exports.default = ResettingAccountBeforeAllTestsTest;
|
43
50
|
//@ts-ignore
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export declare class ResettingLocalEventListeningBeforeSeedingTest extends AbstractSpruceFixtureTest {
|
3
3
|
private static hitCount;
|
4
4
|
protected static beforeEach(): Promise<void>;
|
@@ -5,17 +5,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
7
|
};
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
10
|
+
};
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
9
12
|
exports.ResettingLocalEventListeningBeforeSeedingTest = void 0;
|
10
13
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
11
|
-
const
|
14
|
+
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
12
15
|
const constants_1 = require("../../tests/constants");
|
13
|
-
|
16
|
+
const login_1 = __importDefault(require("../../tests/decorators/login"));
|
17
|
+
const seed_1 = __importDefault(require("../../tests/decorators/seed"));
|
18
|
+
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
19
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
20
|
+
let ResettingLocalEventListeningBeforeSeedingTest = class ResettingLocalEventListeningBeforeSeedingTest extends AbstractSpruceFixtureTest_1.default {
|
14
21
|
static async beforeEach() {
|
15
22
|
await super.beforeEach();
|
16
23
|
}
|
17
24
|
static async testClientIsResetBeforeSeeding() {
|
18
|
-
await
|
25
|
+
await login_1.default.getClient().on('create-organization::v2020_12_25', () => {
|
19
26
|
this.hitCount++;
|
20
27
|
return {
|
21
28
|
organization: {
|
@@ -34,7 +41,7 @@ let ResettingLocalEventListeningBeforeSeedingTest = class ResettingLocalEventLis
|
|
34
41
|
exports.ResettingLocalEventListeningBeforeSeedingTest = ResettingLocalEventListeningBeforeSeedingTest;
|
35
42
|
ResettingLocalEventListeningBeforeSeedingTest.hitCount = 0;
|
36
43
|
__decorate([
|
37
|
-
(0,
|
44
|
+
(0, seed_1.default)('organizations', 1)
|
38
45
|
], ResettingLocalEventListeningBeforeSeedingTest, "beforeEach", null);
|
39
46
|
__decorate([
|
40
47
|
(0, test_utils_1.test)()
|
@@ -43,5 +50,5 @@ __decorate([
|
|
43
50
|
(0, test_utils_1.test)()
|
44
51
|
], ResettingLocalEventListeningBeforeSeedingTest, "hitCountShouldBeZero", null);
|
45
52
|
exports.ResettingLocalEventListeningBeforeSeedingTest = ResettingLocalEventListeningBeforeSeedingTest = __decorate([
|
46
|
-
(0,
|
53
|
+
(0, login_1.default)(constants_1.DEMO_NUMBER_TEST_CLIENT_RECENT)
|
47
54
|
], ResettingLocalEventListeningBeforeSeedingTest);
|
@@ -10,15 +10,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
13
|
-
const __1 = require("../..");
|
14
13
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
15
14
|
const constants_1 = require("../../tests/constants");
|
15
|
+
const login_1 = __importDefault(require("../../tests/decorators/login"));
|
16
|
+
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
17
|
+
const StoreFixture_1 = __importDefault(require("../../tests/fixtures/StoreFixture"));
|
16
18
|
// eslint-disable-next-line spruce/prohibit-import-from-build-folder
|
17
19
|
const Good_store_1 = __importDefault(require("../testDirsAndFiles/one-good-store-skill/build/stores/Good.store"));
|
20
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
18
21
|
let RetainsContractWhenLoggingInUsingDecorator = class RetainsContractWhenLoggingInUsingDecorator extends AbstractSpruceFixtureTest_1.default {
|
19
22
|
static async beforeEach() {
|
20
23
|
await super.beforeEach();
|
21
|
-
this.client =
|
24
|
+
this.client = login_1.default.getClient();
|
22
25
|
}
|
23
26
|
static async clientStillHasContract() {
|
24
27
|
await this.client.on('whoami::v2020_12_25', () => ({
|
@@ -31,7 +34,7 @@ __decorate([
|
|
31
34
|
(0, test_utils_1.test)()
|
32
35
|
], RetainsContractWhenLoggingInUsingDecorator, "clientStillHasContract", null);
|
33
36
|
RetainsContractWhenLoggingInUsingDecorator = __decorate([
|
34
|
-
(0,
|
37
|
+
(0, login_1.default)(constants_1.DEMO_NUMBER_ACCOUNT_RESET)
|
35
38
|
], RetainsContractWhenLoggingInUsingDecorator);
|
36
39
|
exports.default = RetainsContractWhenLoggingInUsingDecorator;
|
37
|
-
|
40
|
+
StoreFixture_1.default.setStore('good', Good_store_1.default);
|
@@ -12,9 +12,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
13
13
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
14
14
|
const test_utils_2 = require("@sprucelabs/test-utils");
|
15
|
-
const __1 = require("../..");
|
16
15
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
17
16
|
const constants_1 = require("../../tests/constants");
|
17
|
+
const login_1 = __importDefault(require("../../tests/decorators/login"));
|
18
|
+
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
19
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
18
20
|
let SkillFixtureTest = class SkillFixtureTest extends AbstractSpruceFixtureTest_1.default {
|
19
21
|
static async beforeEach() {
|
20
22
|
await super.beforeEach();
|
@@ -111,6 +113,6 @@ __decorate([
|
|
111
113
|
(0, test_utils_1.test)()
|
112
114
|
], SkillFixtureTest, "canPassThroughPersonFixture", null);
|
113
115
|
SkillFixtureTest = __decorate([
|
114
|
-
(0,
|
116
|
+
(0, login_1.default)(constants_1.DEMO_NUMBER_SKILL_FIXTURE)
|
115
117
|
], SkillFixtureTest);
|
116
118
|
exports.default = SkillFixtureTest;
|
@@ -20,6 +20,7 @@ const seed_1 = __importDefault(require("../../../tests/decorators/seed"));
|
|
20
20
|
// eslint-disable-next-line spruce/prohibit-import-from-build-folder
|
21
21
|
const Good_store_1 = __importDefault(require("../../testDirsAndFiles/one-good-store-skill/build/stores/Good.store"));
|
22
22
|
const DummyStore_1 = require("../databases/DummyStore");
|
23
|
+
__1.MercuryFixture.setShouldRequireLocalListeners(false);
|
23
24
|
let UsingDecoratorsTest = class UsingDecoratorsTest extends AbstractSpruceFixtureTest_1.default {
|
24
25
|
static async beforeEach() {
|
25
26
|
test_utils_1.assert.isTrue(mercury_client_1.MercuryClientFactory.isInTestMode());
|
@@ -15,6 +15,8 @@ const constants_1 = require("../../../tests/constants");
|
|
15
15
|
const install_1 = __importDefault(require("../../../tests/decorators/install"));
|
16
16
|
const login_1 = __importDefault(require("../../../tests/decorators/login"));
|
17
17
|
const seed_1 = __importDefault(require("../../../tests/decorators/seed"));
|
18
|
+
const MercuryFixture_1 = __importDefault(require("../../../tests/fixtures/MercuryFixture"));
|
19
|
+
MercuryFixture_1.default.setShouldRequireLocalListeners(false);
|
18
20
|
let UsingDecoratorsToInstallSkills = class UsingDecoratorsToInstallSkills extends AbstractSpruceFixtureTest_1.default {
|
19
21
|
static async beforeEach() {
|
20
22
|
await super.beforeEach();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class DecoratingEmitToPassThroughProxyTest extends AbstractSpruceFixtureTest {
|
3
3
|
private static lastInstance;
|
4
4
|
protected static sharesInstance(): void;
|
@@ -14,9 +14,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
14
14
|
});
|
15
15
|
};
|
16
16
|
import { test, assert } from '@sprucelabs/test-utils';
|
17
|
-
import { AbstractSpruceFixtureTest, login } from '../../index.js';
|
18
17
|
import ClientProxyDecorator from '../../ClientProxyDecorator.js';
|
18
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
19
19
|
import { DEMO_NUMBER } from '../../tests/constants.js';
|
20
|
+
import login from '../../tests/decorators/login.js';
|
21
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
22
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
20
23
|
let DecoratingEmitToPassThroughProxyTest = class DecoratingEmitToPassThroughProxyTest extends AbstractSpruceFixtureTest {
|
21
24
|
static sharesInstance() {
|
22
25
|
const instance = this.getDecorator();
|
@@ -16,11 +16,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
16
16
|
import { MercuryTestClient } from '@sprucelabs/mercury-client';
|
17
17
|
import { coreEventContracts } from '@sprucelabs/mercury-core-events';
|
18
18
|
import { assert, test } from '@sprucelabs/test-utils';
|
19
|
-
import { login, seed, StoreFixture } from '../../index.js';
|
20
19
|
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
21
20
|
import { DEMO_NUMBER_ACCOUNT_RESET } from '../../tests/constants.js';
|
21
|
+
import login from '../../tests/decorators/login.js';
|
22
|
+
import seed from '../../tests/decorators/seed.js';
|
23
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
24
|
+
import StoreFixture from '../../tests/fixtures/StoreFixture.js';
|
22
25
|
// eslint-disable-next-line spruce/prohibit-import-from-build-folder
|
23
26
|
import GoodStore from '../testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js';
|
27
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
24
28
|
let hitCount = 0;
|
25
29
|
MercuryTestClient.reset = () => { };
|
26
30
|
//@ts-ignore
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class LoginDecoratorHandlingProxiesForMeTest extends AbstractSpruceFixtureTest {
|
3
3
|
private static lastToken?;
|
4
4
|
protected static proxyTokenGeneratorReturnsExpectedProxyToken(expected: string): Promise<void>;
|
@@ -15,9 +15,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
15
15
|
};
|
16
16
|
import { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
|
17
17
|
import { test, assert } from '@sprucelabs/test-utils';
|
18
|
-
import { AbstractSpruceFixtureTest, login } from '../../index.js';
|
19
18
|
import ClientProxyDecorator from '../../ClientProxyDecorator.js';
|
19
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
20
20
|
import { DEMO_NUMBER_LOGIN_DECORATOR, DEMO_NUMBER_LOGIN_DECORATOR_2, } from '../../tests/constants.js';
|
21
|
+
import login from '../../tests/decorators/login.js';
|
22
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
23
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
21
24
|
let LoginDecoratorHandlingProxiesForMeTest = class LoginDecoratorHandlingProxiesForMeTest extends AbstractSpruceFixtureTest {
|
22
25
|
static proxyTokenGeneratorReturnsExpectedProxyToken(expected) {
|
23
26
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class MakingSureLocalEventsAreHandledLocallyTest extends AbstractSpruceFixtureTest {
|
3
3
|
protected static throwsWhenNoListenerSetForLocalEvent(): Promise<void>;
|
4
4
|
}
|
@@ -16,8 +16,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
16
16
|
import { MercuryTestClient } from '@sprucelabs/mercury-client';
|
17
17
|
import { AuthService } from '@sprucelabs/spruce-skill-utils';
|
18
18
|
import { assert, test } from '@sprucelabs/test-utils';
|
19
|
-
import
|
19
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
20
20
|
import { DEMO_NUMBER_HANDLING_EVENTS_LOCALLY } from '../../tests/constants.js';
|
21
|
+
import login from '../../tests/decorators/login.js';
|
22
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
23
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
21
24
|
let MakingSureLocalEventsAreHandledLocallyTest = class MakingSureLocalEventsAreHandledLocallyTest extends AbstractSpruceFixtureTest {
|
22
25
|
static throwsWhenNoListenerSetForLocalEvent() {
|
23
26
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -14,6 +14,7 @@ export default class MercuryFixtureTest extends AbstractSpruceFixtureTest {
|
|
14
14
|
protected static allClientsGoingForwardUseThatClient(): Promise<void>;
|
15
15
|
protected static resetsDefaultClientBeforeEach(): Promise<void>;
|
16
16
|
protected static canForceNewClient(): Promise<void>;
|
17
|
+
protected static setsRequiresLocalListenersByDefault(): Promise<void>;
|
17
18
|
private static connectToApi;
|
18
19
|
private static createDirWriteContractFileAndSetCwd;
|
19
20
|
}
|
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
13
13
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
14
14
|
});
|
15
15
|
};
|
16
|
-
import { connectionStatusContract, } from '@sprucelabs/mercury-client';
|
16
|
+
import { MercuryTestClient, connectionStatusContract, } from '@sprucelabs/mercury-client';
|
17
17
|
import { coreEventContracts } from '@sprucelabs/mercury-core-events';
|
18
18
|
import { eventContractUtil } from '@sprucelabs/spruce-event-utils';
|
19
19
|
import { diskUtil, HASH_SPRUCE_BUILD_DIR } from '@sprucelabs/spruce-skill-utils';
|
@@ -147,6 +147,11 @@ export default class MercuryFixtureTest extends AbstractSpruceFixtureTest {
|
|
147
147
|
assert.isNotEqual(client, client2);
|
148
148
|
});
|
149
149
|
}
|
150
|
+
static setsRequiresLocalListenersByDefault() {
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
152
|
+
assert.isTrue(MercuryTestClient.getShouldRequireLocalListeners());
|
153
|
+
});
|
154
|
+
}
|
150
155
|
static connectToApi(options) {
|
151
156
|
return __awaiter(this, void 0, void 0, function* () {
|
152
157
|
return yield new FixtureFactory({ cwd: this.cwd })
|
@@ -213,3 +218,6 @@ __decorate([
|
|
213
218
|
__decorate([
|
214
219
|
test()
|
215
220
|
], MercuryFixtureTest, "canForceNewClient", null);
|
221
|
+
__decorate([
|
222
|
+
test()
|
223
|
+
], MercuryFixtureTest, "setsRequiresLocalListenersByDefault", null);
|
@@ -22,6 +22,7 @@ import { MercuryFixture } from '../../index.js';
|
|
22
22
|
import { DEMO_NUMBER_SECOND_LOGIN, DEMO_NUMBER, DEMO_NUMBER_PERSON_FIXTURE, } from '../../tests/constants.js';
|
23
23
|
import FixtureFactory from '../../tests/fixtures/FixtureFactory.js';
|
24
24
|
dotenv.config();
|
25
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
25
26
|
export default class PersonFixtureTest extends AbstractSpruceTest {
|
26
27
|
static beforeEach() {
|
27
28
|
const _super = Object.create(null, {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class ResettingAccountBeforeAllTestsTest extends AbstractSpruceFixtureTest {
|
3
3
|
protected static beforeAll(): Promise<void>;
|
4
4
|
protected static delayToGivesSeederTimeToWrite(): Promise<void>;
|
@@ -15,8 +15,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
15
15
|
};
|
16
16
|
import { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
|
17
17
|
import { assert, test } from '@sprucelabs/test-utils';
|
18
|
-
import
|
18
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
19
19
|
import { DEMO_NUMBER_ACCOUNT_BEFORE_ALL_RESET_LOCATION } from '../../tests/constants.js';
|
20
|
+
import login from '../../tests/decorators/login.js';
|
21
|
+
import seed from '../../tests/decorators/seed.js';
|
22
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
23
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
20
24
|
let ResettingAccountBeforeAllTestsTest = class ResettingAccountBeforeAllTestsTest extends AbstractSpruceFixtureTest {
|
21
25
|
static beforeAll() {
|
22
26
|
const _super = Object.create(null, {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class ResettingAccountAfterAllTestsTest extends AbstractSpruceFixtureTest {
|
3
3
|
protected static afterAll(): Promise<void>;
|
4
4
|
protected static seedMoar(): Promise<void>;
|
@@ -14,8 +14,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
14
14
|
});
|
15
15
|
};
|
16
16
|
import { assert, test } from '@sprucelabs/test-utils';
|
17
|
-
import
|
17
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
18
18
|
import { DEMO_NUMBER_ACCOUNT_AFTER_ALL_RESET } from '../../tests/constants.js';
|
19
|
+
import login from '../../tests/decorators/login.js';
|
20
|
+
import seed from '../../tests/decorators/seed.js';
|
21
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
22
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
19
23
|
let ResettingAccountAfterAllTestsTest = class ResettingAccountAfterAllTestsTest extends AbstractSpruceFixtureTest {
|
20
24
|
static afterAll() {
|
21
25
|
const _super = Object.create(null, {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export default class ResettingAccountBeforeAllTestsTest extends AbstractSpruceFixtureTest {
|
3
3
|
protected static beforeAll(): Promise<void>;
|
4
4
|
protected static delayToGivesSeederTimeToWrite(): Promise<void>;
|
@@ -14,8 +14,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
14
14
|
});
|
15
15
|
};
|
16
16
|
import { assert, test } from '@sprucelabs/test-utils';
|
17
|
-
import
|
17
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
18
18
|
import { DEMO_NUMBER_ACCOUNT_BEFORE_ALL_RESET } from '../../tests/constants.js';
|
19
|
+
import login from '../../tests/decorators/login.js';
|
20
|
+
import seed from '../../tests/decorators/seed.js';
|
21
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
22
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
19
23
|
let ResettingAccountBeforeAllTestsTest = class ResettingAccountBeforeAllTestsTest extends AbstractSpruceFixtureTest {
|
20
24
|
static beforeAll() {
|
21
25
|
const _super = Object.create(null, {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest';
|
2
2
|
export declare class ResettingLocalEventListeningBeforeSeedingTest extends AbstractSpruceFixtureTest {
|
3
3
|
private static hitCount;
|
4
4
|
protected static beforeEach(): Promise<void>;
|
@@ -14,8 +14,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
14
14
|
});
|
15
15
|
};
|
16
16
|
import { assert, generateId, test } from '@sprucelabs/test-utils';
|
17
|
-
import
|
17
|
+
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
18
18
|
import { DEMO_NUMBER_TEST_CLIENT_RECENT } from '../../tests/constants.js';
|
19
|
+
import login from '../../tests/decorators/login.js';
|
20
|
+
import seed from '../../tests/decorators/seed.js';
|
21
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
22
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
19
23
|
let ResettingLocalEventListeningBeforeSeedingTest = class ResettingLocalEventListeningBeforeSeedingTest extends AbstractSpruceFixtureTest {
|
20
24
|
static beforeEach() {
|
21
25
|
const _super = Object.create(null, {
|
@@ -14,11 +14,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
14
14
|
});
|
15
15
|
};
|
16
16
|
import { test } from '@sprucelabs/test-utils';
|
17
|
-
import { login, StoreFixture } from '../../index.js';
|
18
17
|
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
19
18
|
import { DEMO_NUMBER_ACCOUNT_RESET } from '../../tests/constants.js';
|
19
|
+
import login from '../../tests/decorators/login.js';
|
20
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
21
|
+
import StoreFixture from '../../tests/fixtures/StoreFixture.js';
|
20
22
|
// eslint-disable-next-line spruce/prohibit-import-from-build-folder
|
21
23
|
import GoodStore from '../testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js';
|
24
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
22
25
|
let RetainsContractWhenLoggingInUsingDecorator = class RetainsContractWhenLoggingInUsingDecorator extends AbstractSpruceFixtureTest {
|
23
26
|
static beforeEach() {
|
24
27
|
const _super = Object.create(null, {
|
@@ -16,9 +16,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
16
16
|
import { eventAssertUtil, eventResponseUtil, } from '@sprucelabs/spruce-event-utils';
|
17
17
|
import { test, assert } from '@sprucelabs/test-utils';
|
18
18
|
import { errorAssert } from '@sprucelabs/test-utils';
|
19
|
-
import { login } from '../../index.js';
|
20
19
|
import AbstractSpruceFixtureTest from '../../tests/AbstractSpruceFixtureTest.js';
|
21
20
|
import { DEMO_NUMBER_SKILL_FIXTURE } from '../../tests/constants.js';
|
21
|
+
import login from '../../tests/decorators/login.js';
|
22
|
+
import MercuryFixture from '../../tests/fixtures/MercuryFixture.js';
|
23
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
22
24
|
let SkillFixtureTest = class SkillFixtureTest extends AbstractSpruceFixtureTest {
|
23
25
|
static beforeEach() {
|
24
26
|
const _super = Object.create(null, {
|
@@ -24,6 +24,7 @@ import seed from '../../../tests/decorators/seed.js';
|
|
24
24
|
// eslint-disable-next-line spruce/prohibit-import-from-build-folder
|
25
25
|
import GoodStore from '../../testDirsAndFiles/one-good-store-skill/build/stores/Good.store.js';
|
26
26
|
import { DummyStore } from '../databases/DummyStore.js';
|
27
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
27
28
|
let UsingDecoratorsTest = class UsingDecoratorsTest extends AbstractSpruceFixtureTest {
|
28
29
|
static beforeEach() {
|
29
30
|
const _super = Object.create(null, {
|
@@ -19,6 +19,8 @@ import { DEMO_NUMBER_SKILL_DECORATORS } from '../../../tests/constants.js';
|
|
19
19
|
import install from '../../../tests/decorators/install.js';
|
20
20
|
import login from '../../../tests/decorators/login.js';
|
21
21
|
import seed from '../../../tests/decorators/seed.js';
|
22
|
+
import MercuryFixture from '../../../tests/fixtures/MercuryFixture.js';
|
23
|
+
MercuryFixture.setShouldRequireLocalListeners(false);
|
22
24
|
let UsingDecoratorsToInstallSkills = class UsingDecoratorsToInstallSkills extends AbstractSpruceFixtureTest {
|
23
25
|
static beforeEach() {
|
24
26
|
const _super = Object.create(null, {
|
@@ -9,6 +9,7 @@ export default class MercuryFixture {
|
|
9
9
|
private static shouldMixinCoreEventContractWhenImportingLocal;
|
10
10
|
private static defaultClient?;
|
11
11
|
private static shouldAutomaticallyClearDefaultClient;
|
12
|
+
private static shouldRequireLocalListeners;
|
12
13
|
static setDefaultClient(client: MercuryClient): void;
|
13
14
|
static clearDefaultClient(): void;
|
14
15
|
static getDefaultClient(): MercuryClient | undefined;
|
@@ -21,6 +22,7 @@ export default class MercuryFixture {
|
|
21
22
|
destroy(): Promise<void>;
|
22
23
|
static beforeAll(): void;
|
23
24
|
static beforeEach(cwd: string): Promise<void>;
|
25
|
+
static setShouldRequireLocalListeners(shouldRequireLocal: boolean): void;
|
24
26
|
static setShouldMixinCoreEventContractsWhenImportingLocal(shouldMixin: boolean): void;
|
25
27
|
static setShouldAutoImportContracts(shouldImport: boolean): void;
|
26
28
|
}
|
@@ -137,6 +137,7 @@ class MercuryFixture {
|
|
137
137
|
}
|
138
138
|
MercuryClientFactory.reset();
|
139
139
|
MercuryClientFactory.setIsTestMode(true);
|
140
|
+
MercuryTestClient.setShouldRequireLocalListeners(this.shouldRequireLocalListeners);
|
140
141
|
if (this.shouldAutomaticallyClearDefaultClient) {
|
141
142
|
this.clearDefaultClient();
|
142
143
|
}
|
@@ -152,6 +153,10 @@ class MercuryFixture {
|
|
152
153
|
catch (_b) { }
|
153
154
|
});
|
154
155
|
}
|
156
|
+
static setShouldRequireLocalListeners(shouldRequireLocal) {
|
157
|
+
this.shouldRequireLocalListeners = shouldRequireLocal;
|
158
|
+
MercuryTestClient.setShouldRequireLocalListeners(shouldRequireLocal);
|
159
|
+
}
|
155
160
|
static setShouldMixinCoreEventContractsWhenImportingLocal(shouldMixin) {
|
156
161
|
this.shouldMixinCoreEventContractWhenImportingLocal = shouldMixin;
|
157
162
|
}
|
@@ -162,4 +167,5 @@ class MercuryFixture {
|
|
162
167
|
MercuryFixture.shouldAutoImportContracts = true;
|
163
168
|
MercuryFixture.shouldMixinCoreEventContractWhenImportingLocal = false;
|
164
169
|
MercuryFixture.shouldAutomaticallyClearDefaultClient = true;
|
170
|
+
MercuryFixture.shouldRequireLocalListeners = true;
|
165
171
|
export default MercuryFixture;
|
@@ -9,6 +9,7 @@ export default class MercuryFixture {
|
|
9
9
|
private static shouldMixinCoreEventContractWhenImportingLocal;
|
10
10
|
private static defaultClient?;
|
11
11
|
private static shouldAutomaticallyClearDefaultClient;
|
12
|
+
private static shouldRequireLocalListeners;
|
12
13
|
static setDefaultClient(client: MercuryClient): void;
|
13
14
|
static clearDefaultClient(): void;
|
14
15
|
static getDefaultClient(): MercuryClient | undefined;
|
@@ -21,6 +22,7 @@ export default class MercuryFixture {
|
|
21
22
|
destroy(): Promise<void>;
|
22
23
|
static beforeAll(): void;
|
23
24
|
static beforeEach(cwd: string): Promise<void>;
|
25
|
+
static setShouldRequireLocalListeners(shouldRequireLocal: boolean): void;
|
24
26
|
static setShouldMixinCoreEventContractsWhenImportingLocal(shouldMixin: boolean): void;
|
25
27
|
static setShouldAutoImportContracts(shouldImport: boolean): void;
|
26
28
|
}
|
@@ -125,6 +125,7 @@ class MercuryFixture {
|
|
125
125
|
}
|
126
126
|
mercury_client_1.MercuryClientFactory.reset();
|
127
127
|
mercury_client_1.MercuryClientFactory.setIsTestMode(true);
|
128
|
+
mercury_client_1.MercuryTestClient.setShouldRequireLocalListeners(this.shouldRequireLocalListeners);
|
128
129
|
if (this.shouldAutomaticallyClearDefaultClient) {
|
129
130
|
this.clearDefaultClient();
|
130
131
|
}
|
@@ -139,6 +140,10 @@ class MercuryFixture {
|
|
139
140
|
}
|
140
141
|
catch (_b) { }
|
141
142
|
}
|
143
|
+
static setShouldRequireLocalListeners(shouldRequireLocal) {
|
144
|
+
this.shouldRequireLocalListeners = shouldRequireLocal;
|
145
|
+
mercury_client_1.MercuryTestClient.setShouldRequireLocalListeners(shouldRequireLocal);
|
146
|
+
}
|
142
147
|
static setShouldMixinCoreEventContractsWhenImportingLocal(shouldMixin) {
|
143
148
|
this.shouldMixinCoreEventContractWhenImportingLocal = shouldMixin;
|
144
149
|
}
|
@@ -149,4 +154,5 @@ class MercuryFixture {
|
|
149
154
|
MercuryFixture.shouldAutoImportContracts = true;
|
150
155
|
MercuryFixture.shouldMixinCoreEventContractWhenImportingLocal = false;
|
151
156
|
MercuryFixture.shouldAutomaticallyClearDefaultClient = true;
|
157
|
+
MercuryFixture.shouldRequireLocalListeners = true;
|
152
158
|
exports.default = MercuryFixture;
|
package/package.json
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
"@sprucelabs/spruce-test-fixtures"
|
14
14
|
]
|
15
15
|
},
|
16
|
-
"version": "60.1.
|
16
|
+
"version": "60.1.160",
|
17
17
|
"files": [
|
18
18
|
"build/**/*",
|
19
19
|
"!build/__tests__",
|
@@ -62,27 +62,27 @@
|
|
62
62
|
"lint.tsc": "tsc -p . --noEmit"
|
63
63
|
},
|
64
64
|
"dependencies": {
|
65
|
-
"@sprucelabs/data-stores": "^26.4.
|
65
|
+
"@sprucelabs/data-stores": "^26.4.12",
|
66
66
|
"@sprucelabs/error": "^5.1.57",
|
67
|
-
"@sprucelabs/heartwood-view-controllers": "^108.
|
68
|
-
"@sprucelabs/mercury-client": "^41.0.
|
69
|
-
"@sprucelabs/mercury-core-events": "^22.1.
|
70
|
-
"@sprucelabs/mercury-event-emitter": "^41.0.
|
71
|
-
"@sprucelabs/schema": "^29.3.
|
72
|
-
"@sprucelabs/spruce-core-schemas": "^39.0.
|
73
|
-
"@sprucelabs/spruce-event-utils": "^38.0.
|
74
|
-
"@sprucelabs/spruce-permission-utils": "^7.0.
|
75
|
-
"@sprucelabs/spruce-skill-booter": "^60.1.
|
76
|
-
"@sprucelabs/spruce-skill-utils": "^30.1.
|
77
|
-
"@sprucelabs/test-utils": "^4.0.
|
67
|
+
"@sprucelabs/heartwood-view-controllers": "^108.40.0",
|
68
|
+
"@sprucelabs/mercury-client": "^41.0.211",
|
69
|
+
"@sprucelabs/mercury-core-events": "^22.1.17",
|
70
|
+
"@sprucelabs/mercury-event-emitter": "^41.0.211",
|
71
|
+
"@sprucelabs/schema": "^29.3.11",
|
72
|
+
"@sprucelabs/spruce-core-schemas": "^39.0.179",
|
73
|
+
"@sprucelabs/spruce-event-utils": "^38.0.206",
|
74
|
+
"@sprucelabs/spruce-permission-utils": "^7.0.357",
|
75
|
+
"@sprucelabs/spruce-skill-booter": "^60.1.160",
|
76
|
+
"@sprucelabs/spruce-skill-utils": "^30.1.66",
|
77
|
+
"@sprucelabs/test-utils": "^4.0.97",
|
78
78
|
"dotenv": "^16.3.1",
|
79
79
|
"unique-names-generator": "^4.7.1"
|
80
80
|
},
|
81
81
|
"devDependencies": {
|
82
|
-
"@sprucelabs/esm-postbuild": "^5.0.
|
83
|
-
"@sprucelabs/jest-json-reporter": "^7.0.
|
82
|
+
"@sprucelabs/esm-postbuild": "^5.0.122",
|
83
|
+
"@sprucelabs/jest-json-reporter": "^7.0.143",
|
84
84
|
"@sprucelabs/jest-sheets-reporter": "^3.0.26",
|
85
|
-
"@sprucelabs/mercury-types": "^46.0.
|
85
|
+
"@sprucelabs/mercury-types": "^46.0.174",
|
86
86
|
"@sprucelabs/resolve-path-aliases": "^1.1.275",
|
87
87
|
"@sprucelabs/semantic-release": "^4.0.8",
|
88
88
|
"@sprucelabs/test": "^8.0.39",
|
@@ -132,5 +132,5 @@
|
|
132
132
|
]
|
133
133
|
]
|
134
134
|
},
|
135
|
-
"gitHead": "
|
135
|
+
"gitHead": "ceada6a8f5557703084a2504cde36103559734fc"
|
136
136
|
}
|