@rotorsoft/act-tck 1.38.0 → 1.38.2
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 +56 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAQV,KAAK,EAIN,MAAM,sBAAsB,CAAC;AAc9B;;;;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;;;;;;;;;;;;;;OAcG;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,IA0sKtD,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -3536,6 +3536,62 @@ var runStoreTck = (options) => {
|
|
|
3536
3536
|
);
|
|
3537
3537
|
(0, import_vitest9.expect)(remaining[0].data).toEqual({ count: 7 });
|
|
3538
3538
|
});
|
|
3539
|
+
(0, import_vitest9.it)("leaves exactly one seed when a stream is listed twice (#1677)", async () => {
|
|
3540
|
+
const s = `trunc-dup-${uid()}`;
|
|
3541
|
+
await store.commit(
|
|
3542
|
+
s,
|
|
3543
|
+
[inc(1), inc(2)],
|
|
3544
|
+
make_meta({ stream: s })
|
|
3545
|
+
);
|
|
3546
|
+
const result = await store.truncate([
|
|
3547
|
+
{ stream: s, snapshot: { count: 1 } },
|
|
3548
|
+
{ stream: s, snapshot: { count: 2 } }
|
|
3549
|
+
]);
|
|
3550
|
+
const remaining = [];
|
|
3551
|
+
await store.query(
|
|
3552
|
+
(e) => {
|
|
3553
|
+
remaining.push(e);
|
|
3554
|
+
},
|
|
3555
|
+
{ stream: s, stream_exact: true, with_snaps: true }
|
|
3556
|
+
);
|
|
3557
|
+
(0, import_vitest9.expect)(remaining).toHaveLength(1);
|
|
3558
|
+
(0, import_vitest9.expect)(remaining[0].data).toEqual({ count: 2 });
|
|
3559
|
+
(0, import_vitest9.expect)(result.get(s)?.deleted).toBe(1);
|
|
3560
|
+
});
|
|
3561
|
+
(0, import_vitest9.it)("applies windowed targets before full ones (#1677)", async () => {
|
|
3562
|
+
const s = `trunc-mix-${uid()}`;
|
|
3563
|
+
await store.commit(
|
|
3564
|
+
s,
|
|
3565
|
+
[inc(1)],
|
|
3566
|
+
make_meta({ stream: s })
|
|
3567
|
+
);
|
|
3568
|
+
await store.commit(
|
|
3569
|
+
s,
|
|
3570
|
+
[inc(2)],
|
|
3571
|
+
make_meta({ stream: s })
|
|
3572
|
+
);
|
|
3573
|
+
await (0, import_act2.sleep)(5);
|
|
3574
|
+
const cutoff = /* @__PURE__ */ new Date();
|
|
3575
|
+
const result = await store.truncate([
|
|
3576
|
+
{ stream: s, before: cutoff },
|
|
3577
|
+
{ stream: s, snapshot: { count: 9 } }
|
|
3578
|
+
]);
|
|
3579
|
+
const entry2 = result.get(s);
|
|
3580
|
+
(0, import_vitest9.expect)(entry2).toBeDefined();
|
|
3581
|
+
(0, import_vitest9.expect)(entry2.before).toBeUndefined();
|
|
3582
|
+
(0, import_vitest9.expect)(entry2.committed.name).toBe(
|
|
3583
|
+
"__snapshot__"
|
|
3584
|
+
);
|
|
3585
|
+
const remaining = [];
|
|
3586
|
+
await store.query(
|
|
3587
|
+
(e) => {
|
|
3588
|
+
remaining.push(e);
|
|
3589
|
+
},
|
|
3590
|
+
{ stream: s, stream_exact: true, with_snaps: true }
|
|
3591
|
+
);
|
|
3592
|
+
(0, import_vitest9.expect)(remaining).toHaveLength(1);
|
|
3593
|
+
(0, import_vitest9.expect)(remaining[0].data).toEqual({ count: 9 });
|
|
3594
|
+
});
|
|
3539
3595
|
(0, import_vitest9.it)("returns an empty map for empty input", async () => {
|
|
3540
3596
|
const result = await store.truncate([]);
|
|
3541
3597
|
(0, import_vitest9.expect)(result.size).toBe(0);
|