@rotorsoft/act-tck 1.16.0 → 1.17.0
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 +46 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -591,6 +591,52 @@ var runStoreTck = (options) => {
|
|
|
591
591
|
});
|
|
592
592
|
(0, import_vitest6.expect)(limited).toHaveLength(2);
|
|
593
593
|
});
|
|
594
|
+
(0, import_vitest6.it)("with_snaps resumes from the latest snapshot per stream", async () => {
|
|
595
|
+
const s = `q-snap-${uid()}`;
|
|
596
|
+
await store.commit(
|
|
597
|
+
s,
|
|
598
|
+
[inc(1), inc(1)],
|
|
599
|
+
make_meta({ stream: s })
|
|
600
|
+
);
|
|
601
|
+
const [snap] = await store.commit(
|
|
602
|
+
s,
|
|
603
|
+
[{ name: import_act.SNAP_EVENT, data: { count: 2 } }],
|
|
604
|
+
make_meta({ stream: s })
|
|
605
|
+
);
|
|
606
|
+
await store.commit(
|
|
607
|
+
s,
|
|
608
|
+
[inc(1), inc(1), inc(1)],
|
|
609
|
+
make_meta({ stream: s })
|
|
610
|
+
);
|
|
611
|
+
const from_snap = await collect(store, {
|
|
612
|
+
stream: s,
|
|
613
|
+
stream_exact: true,
|
|
614
|
+
with_snaps: true
|
|
615
|
+
});
|
|
616
|
+
(0, import_vitest6.expect)(from_snap).toHaveLength(4);
|
|
617
|
+
(0, import_vitest6.expect)(from_snap[0].name).toBe(import_act.SNAP_EVENT);
|
|
618
|
+
const domain = await collect(store, { stream: s, stream_exact: true });
|
|
619
|
+
(0, import_vitest6.expect)(domain).toHaveLength(5);
|
|
620
|
+
const after_snap = await collect(store, {
|
|
621
|
+
stream: s,
|
|
622
|
+
stream_exact: true,
|
|
623
|
+
with_snaps: true,
|
|
624
|
+
after: snap.id
|
|
625
|
+
});
|
|
626
|
+
(0, import_vitest6.expect)(after_snap).toHaveLength(3);
|
|
627
|
+
const s2 = `q-nosnap-${uid()}`;
|
|
628
|
+
await store.commit(
|
|
629
|
+
s2,
|
|
630
|
+
[inc(1), inc(1)],
|
|
631
|
+
make_meta({ stream: s2 })
|
|
632
|
+
);
|
|
633
|
+
const full = await collect(store, {
|
|
634
|
+
stream: s2,
|
|
635
|
+
stream_exact: true,
|
|
636
|
+
with_snaps: true
|
|
637
|
+
});
|
|
638
|
+
(0, import_vitest6.expect)(full).toHaveLength(2);
|
|
639
|
+
});
|
|
594
640
|
(0, import_vitest6.it)("supports backward traversal", async () => {
|
|
595
641
|
const s = `q-back-${uid()}`;
|
|
596
642
|
const committed = await store.commit(
|