eventmodeler 0.3.9 → 0.3.10
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.
|
@@ -261,6 +261,11 @@ function formatScenarioThen(model, then) {
|
|
|
261
261
|
},
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
+
if (then.type === 'noCommand') {
|
|
265
|
+
return {
|
|
266
|
+
type: 'noCommand',
|
|
267
|
+
};
|
|
268
|
+
}
|
|
264
269
|
if (then.type === 'readModelAssertion' && then.readModelAssertion) {
|
|
265
270
|
const rm = model.readModels.get(then.readModelAssertion.readModelStickyId);
|
|
266
271
|
return {
|
|
@@ -367,6 +367,9 @@ function formatSliceXml(model, slice) {
|
|
|
367
367
|
? ` <command type="${escapeXml(name)}">${escapeXmlText(values)}</command>\n`
|
|
368
368
|
: ` <command type="${escapeXml(name)}"/>\n`;
|
|
369
369
|
}
|
|
370
|
+
else if (scenario.then.type === 'noCommand') {
|
|
371
|
+
xml += ' <no-command/>\n';
|
|
372
|
+
}
|
|
370
373
|
else if (scenario.then.type === 'readModelAssertion' && scenario.then.readModelAssertion) {
|
|
371
374
|
const assertion = scenario.then.readModelAssertion;
|
|
372
375
|
const rm = model.readModels.get(assertion.readModelStickyId);
|
|
@@ -629,6 +632,11 @@ function formatSliceJson(model, slice) {
|
|
|
629
632
|
...(scenario.then.expectedCommand.fieldValues && Object.keys(scenario.then.expectedCommand.fieldValues).length > 0 ? { fieldValues: scenario.then.expectedCommand.fieldValues } : {})
|
|
630
633
|
};
|
|
631
634
|
}
|
|
635
|
+
else if (scenario.then.type === 'noCommand') {
|
|
636
|
+
scenarioObj.then = {
|
|
637
|
+
type: 'noCommand'
|
|
638
|
+
};
|
|
639
|
+
}
|
|
632
640
|
else if (scenario.then.type === 'readModelAssertion' && scenario.then.readModelAssertion) {
|
|
633
641
|
const assertion = scenario.then.readModelAssertion;
|
|
634
642
|
const rm = model.readModels.get(assertion.readModelStickyId);
|
package/dist/types.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface ReadModelAssertion {
|
|
|
22
22
|
givenEvents: EventReference[];
|
|
23
23
|
expectedFieldValues: Record<string, unknown>;
|
|
24
24
|
}
|
|
25
|
-
export type ScenarioThenType = 'error' | 'events' | 'readModelAssertion' | 'command';
|
|
25
|
+
export type ScenarioThenType = 'error' | 'events' | 'readModelAssertion' | 'command' | 'noCommand';
|
|
26
26
|
export interface ScenarioThen {
|
|
27
27
|
type: ScenarioThenType;
|
|
28
28
|
errorMessage?: string;
|