@rotorsoft/act-tck 1.38.11 → 1.38.12
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 +25 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4502,6 +4502,31 @@ var runStoreTck = (options) => {
|
|
|
4502
4502
|
await cache.dispose();
|
|
4503
4503
|
}
|
|
4504
4504
|
};
|
|
4505
|
+
it7("resets every correlate checkpoint, since the restored log is renumbered", async () => {
|
|
4506
|
+
const correlator = {
|
|
4507
|
+
key: `k-${uid()}`,
|
|
4508
|
+
by: `w-${uid()}`,
|
|
4509
|
+
millis: 6e4
|
|
4510
|
+
};
|
|
4511
|
+
await store.subscribe([], 50);
|
|
4512
|
+
await store.subscribe([], 50, correlator);
|
|
4513
|
+
expect8((await store.subscribe([])).correlated_at).toBe(50);
|
|
4514
|
+
const s = `restore-cp-${uid()}`;
|
|
4515
|
+
const t = /* @__PURE__ */ new Date("2020-01-01T00:00:00.000Z");
|
|
4516
|
+
const result = await restore(
|
|
4517
|
+
as_source([
|
|
4518
|
+
event(1, s, 0, "Incremented", t, { amount: 1 }),
|
|
4519
|
+
event(2, s, 1, "Incremented", t, { amount: 1 })
|
|
4520
|
+
])
|
|
4521
|
+
);
|
|
4522
|
+
expect8(result.kept).toBe(2);
|
|
4523
|
+
const restored = await collect(store, { limit: 10 });
|
|
4524
|
+
const min_id = Math.min(...restored.map((e) => e.id));
|
|
4525
|
+
const shared = (await store.subscribe([])).correlated_at;
|
|
4526
|
+
const keyed = (await store.subscribe([], void 0, correlator)).correlated_at;
|
|
4527
|
+
expect8(shared).toBeLessThan(min_id);
|
|
4528
|
+
expect8(keyed).toBeLessThan(min_id);
|
|
4529
|
+
});
|
|
4505
4530
|
it7("returns kept=0 on an empty source", async () => {
|
|
4506
4531
|
const result = await restore(as_source([]));
|
|
4507
4532
|
expect8(result.kept).toBe(0);
|