@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/index.js CHANGED
@@ -546,6 +546,52 @@ var runStoreTck = (options) => {
546
546
  });
547
547
  expect5(limited).toHaveLength(2);
548
548
  });
549
+ it4("with_snaps resumes from the latest snapshot per stream", async () => {
550
+ const s = `q-snap-${uid()}`;
551
+ await store.commit(
552
+ s,
553
+ [inc(1), inc(1)],
554
+ make_meta({ stream: s })
555
+ );
556
+ const [snap] = await store.commit(
557
+ s,
558
+ [{ name: SNAP_EVENT, data: { count: 2 } }],
559
+ make_meta({ stream: s })
560
+ );
561
+ await store.commit(
562
+ s,
563
+ [inc(1), inc(1), inc(1)],
564
+ make_meta({ stream: s })
565
+ );
566
+ const from_snap = await collect(store, {
567
+ stream: s,
568
+ stream_exact: true,
569
+ with_snaps: true
570
+ });
571
+ expect5(from_snap).toHaveLength(4);
572
+ expect5(from_snap[0].name).toBe(SNAP_EVENT);
573
+ const domain = await collect(store, { stream: s, stream_exact: true });
574
+ expect5(domain).toHaveLength(5);
575
+ const after_snap = await collect(store, {
576
+ stream: s,
577
+ stream_exact: true,
578
+ with_snaps: true,
579
+ after: snap.id
580
+ });
581
+ expect5(after_snap).toHaveLength(3);
582
+ const s2 = `q-nosnap-${uid()}`;
583
+ await store.commit(
584
+ s2,
585
+ [inc(1), inc(1)],
586
+ make_meta({ stream: s2 })
587
+ );
588
+ const full = await collect(store, {
589
+ stream: s2,
590
+ stream_exact: true,
591
+ with_snaps: true
592
+ });
593
+ expect5(full).toHaveLength(2);
594
+ });
549
595
  it4("supports backward traversal", async () => {
550
596
  const s = `q-back-${uid()}`;
551
597
  const committed = await store.commit(