@sprucelabs/spruce-test-fixtures 45.2.6 → 45.2.9
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.
|
@@ -279,7 +279,13 @@ function getPersonById(Class, personId, shouldThrowWhenNotFound = true) {
|
|
|
279
279
|
function fakeUpdatePerson(Class) {
|
|
280
280
|
return __awaiter(this, void 0, void 0, function* () {
|
|
281
281
|
yield eventFaker.on('update-person::v2020_12_25', ({ target, source, payload }) => {
|
|
282
|
-
const person = Class.fakedPeople.find((p) => p.id === (
|
|
282
|
+
const person = Class.fakedPeople.find((p) => (target === null || target === void 0 ? void 0 : target.personId) ? p.id === (target === null || target === void 0 ? void 0 : target.personId) : p.id === (source === null || source === void 0 ? void 0 : source.personId));
|
|
283
|
+
if (!person) {
|
|
284
|
+
throw new SpruceError({
|
|
285
|
+
code: 'INVALID_TARGET',
|
|
286
|
+
friendlyMessage: `I could not update the faked person you were looking for!`,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
283
289
|
person.firstName = payload === null || payload === void 0 ? void 0 : payload.firstName;
|
|
284
290
|
person.lastName = payload === null || payload === void 0 ? void 0 : payload.lastName;
|
|
285
291
|
person.casualName = buildCasualName(person);
|
|
@@ -264,7 +264,13 @@ function getPersonById(Class, personId, shouldThrowWhenNotFound = true) {
|
|
|
264
264
|
}
|
|
265
265
|
async function fakeUpdatePerson(Class) {
|
|
266
266
|
await eventFaker_1.default.on('update-person::v2020_12_25', ({ target, source, payload }) => {
|
|
267
|
-
const person = Class.fakedPeople.find((p) => p.id === (
|
|
267
|
+
const person = Class.fakedPeople.find((p) => (target === null || target === void 0 ? void 0 : target.personId) ? p.id === (target === null || target === void 0 ? void 0 : target.personId) : p.id === (source === null || source === void 0 ? void 0 : source.personId));
|
|
268
|
+
if (!person) {
|
|
269
|
+
throw new SpruceError_1.default({
|
|
270
|
+
code: 'INVALID_TARGET',
|
|
271
|
+
friendlyMessage: `I could not update the faked person you were looking for!`,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
268
274
|
person.firstName = payload === null || payload === void 0 ? void 0 : payload.firstName;
|
|
269
275
|
person.lastName = payload === null || payload === void 0 ? void 0 : payload.lastName;
|
|
270
276
|
person.casualName = buildCasualName(person);
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@sprucelabs/spruce-test-fixtures"
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
|
-
"version": "45.2.
|
|
16
|
+
"version": "45.2.9",
|
|
17
17
|
"files": [
|
|
18
18
|
"build/**/*",
|
|
19
19
|
"!build/__tests__",
|
|
@@ -62,17 +62,17 @@
|
|
|
62
62
|
"lint.tsc": "tsc -p . --noEmit"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@sprucelabs/data-stores": "^18.0.
|
|
65
|
+
"@sprucelabs/data-stores": "^18.0.16",
|
|
66
66
|
"@sprucelabs/error": "^5.0.490",
|
|
67
|
-
"@sprucelabs/heartwood-view-controllers": "^86.14.
|
|
68
|
-
"@sprucelabs/mercury-client": "^31.0.
|
|
69
|
-
"@sprucelabs/mercury-core-events": "^12.0.
|
|
70
|
-
"@sprucelabs/mercury-event-emitter": "^31.0.
|
|
67
|
+
"@sprucelabs/heartwood-view-controllers": "^86.14.12",
|
|
68
|
+
"@sprucelabs/mercury-client": "^31.0.119",
|
|
69
|
+
"@sprucelabs/mercury-core-events": "^12.0.121",
|
|
70
|
+
"@sprucelabs/mercury-event-emitter": "^31.0.119",
|
|
71
71
|
"@sprucelabs/schema": "^28.4.3",
|
|
72
72
|
"@sprucelabs/spruce-core-schemas": "^34.2.31",
|
|
73
|
-
"@sprucelabs/spruce-event-utils": "^27.0.
|
|
74
|
-
"@sprucelabs/spruce-skill-booter": "^45.2.
|
|
75
|
-
"@sprucelabs/spruce-skill-utils": "^26.4.
|
|
73
|
+
"@sprucelabs/spruce-event-utils": "^27.0.99",
|
|
74
|
+
"@sprucelabs/spruce-skill-booter": "^45.2.9",
|
|
75
|
+
"@sprucelabs/spruce-skill-utils": "^26.4.5",
|
|
76
76
|
"dotenv": "^16.0.1",
|
|
77
77
|
"unique-names-generator": "^4.7.1"
|
|
78
78
|
},
|
|
@@ -131,5 +131,5 @@
|
|
|
131
131
|
]
|
|
132
132
|
]
|
|
133
133
|
},
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "f0aff051d984f427cde193005b47695537c4cdc9"
|
|
135
135
|
}
|