@rotorsoft/act-tck 2.0.0 → 2.1.1
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/dist/.tsbuildinfo +1 -1
- package/dist/@types/store-tck.d.ts.map +1 -1
- package/dist/index.cjs +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -19
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAUV,KAAK,EAIN,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAUV,KAAK,EAIN,MAAM,sBAAsB,CAAC;AAuB9B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;;OAOG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,OAAO,CAAC;IACpD;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACxD;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW,YAAa,eAAe,KAAG,IA62MtD,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1146,6 +1146,7 @@ var runStorePropertyTck = (options) => {
|
|
|
1146
1146
|
|
|
1147
1147
|
// src/store-tck.ts
|
|
1148
1148
|
var import_act2 = require("@rotorsoft/act");
|
|
1149
|
+
var import_adapter = require("@rotorsoft/act/adapter");
|
|
1149
1150
|
var import_vitest9 = require("vitest");
|
|
1150
1151
|
var import_zod2 = require("zod");
|
|
1151
1152
|
var runStoreTck = (options) => {
|
|
@@ -1173,7 +1174,7 @@ var runStoreTck = (options) => {
|
|
|
1173
1174
|
},
|
|
1174
1175
|
row.source !== void 0 ? {
|
|
1175
1176
|
stream: row.source,
|
|
1176
|
-
stream_exact: (0,
|
|
1177
|
+
stream_exact: (0, import_adapter.isStreamName)(row.source, row.stream)
|
|
1177
1178
|
} : {}
|
|
1178
1179
|
);
|
|
1179
1180
|
if (mark > row.at)
|
|
@@ -5444,7 +5445,7 @@ var runStoreTck = (options) => {
|
|
|
5444
5445
|
(0, import_vitest9.expect)(next.id).toBeGreaterThan(head);
|
|
5445
5446
|
});
|
|
5446
5447
|
});
|
|
5447
|
-
beforeEach(async () => {
|
|
5448
|
+
(0, import_vitest9.beforeEach)(async () => {
|
|
5448
5449
|
await store.drop();
|
|
5449
5450
|
await store.seed();
|
|
5450
5451
|
});
|
|
@@ -5743,22 +5744,18 @@ var runStoreTck = (options) => {
|
|
|
5743
5744
|
(0, import_vitest9.expect)(back[1].meta.causation.event?.id).toBe(back[0].id);
|
|
5744
5745
|
(0, import_vitest9.expect)(back[2].meta.causation.event?.id).toBe(back[1].id);
|
|
5745
5746
|
});
|
|
5746
|
-
(0, import_vitest9.it)("
|
|
5747
|
+
(0, import_vitest9.it)("gives a cause missing from the source id -1, so it names no restored event", async () => {
|
|
5747
5748
|
const s = `restore-orphan-${uid()}`;
|
|
5748
5749
|
const t = /* @__PURE__ */ new Date("2020-09-01T00:00:00.000Z");
|
|
5749
5750
|
await restore(
|
|
5750
5751
|
as_source([
|
|
5752
|
+
event(5, s, 0, "Incremented", t, { amount: 1 }),
|
|
5751
5753
|
{
|
|
5752
|
-
|
|
5753
|
-
stream: s,
|
|
5754
|
-
version: 0,
|
|
5755
|
-
name: "Incremented",
|
|
5756
|
-
data: { amount: 1 },
|
|
5757
|
-
created: t,
|
|
5754
|
+
...event(6, s, 1, "Incremented", t, { amount: 1 }),
|
|
5758
5755
|
meta: {
|
|
5759
5756
|
correlation: "c",
|
|
5760
5757
|
causation: {
|
|
5761
|
-
event: { id:
|
|
5758
|
+
event: { id: 1, name: "Pruned", stream: "ghost" }
|
|
5762
5759
|
}
|
|
5763
5760
|
}
|
|
5764
5761
|
}
|
|
@@ -5771,7 +5768,11 @@ var runStoreTck = (options) => {
|
|
|
5771
5768
|
},
|
|
5772
5769
|
{ stream: s, stream_exact: true }
|
|
5773
5770
|
);
|
|
5774
|
-
(0, import_vitest9.expect)(back[
|
|
5771
|
+
(0, import_vitest9.expect)(back[1].meta.causation.event).toEqual({
|
|
5772
|
+
id: -1,
|
|
5773
|
+
name: "Pruned",
|
|
5774
|
+
stream: "ghost"
|
|
5775
|
+
});
|
|
5775
5776
|
});
|
|
5776
5777
|
(0, import_vitest9.it)("rolls back atomically when the source throws mid-iteration", async () => {
|
|
5777
5778
|
const original = `restore-pre-${uid()}`;
|