@rotorsoft/act-tck 1.30.1 → 1.30.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 +30 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -6
- 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":"AAQA,OAAO,KAAK,EAQV,KAAK,EAGN,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;;;;;;;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;CACrD,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,CAA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AAG,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,IA48ItD,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1738,6 +1738,34 @@ var runStoreTck = (options) => {
|
|
|
1738
1738
|
await store.subscribe([{ stream: s }]);
|
|
1739
1739
|
(0, import_vitest9.expect)(await read()).toBe(10);
|
|
1740
1740
|
});
|
|
1741
|
+
(0, import_vitest9.it)("does not claim a fresh subscription with no matching events", async () => {
|
|
1742
|
+
const s = `fresh-empty-${uid()}`;
|
|
1743
|
+
const src = `fresh-src-${uid()}`;
|
|
1744
|
+
await store.subscribe([{ stream: s, source: src }]);
|
|
1745
|
+
const leases = await store.claim(5, 5, `w-${uid()}`, 5e3);
|
|
1746
|
+
(0, import_vitest9.expect)(leases.filter((l) => l.stream === s)).toHaveLength(0);
|
|
1747
|
+
});
|
|
1748
|
+
(0, import_vitest9.it)("claims a fresh subscription as soon as its first event lands", async () => {
|
|
1749
|
+
const s = `fresh-first-${uid()}`;
|
|
1750
|
+
const src = `fresh-first-src-${uid()}`;
|
|
1751
|
+
await store.subscribe([{ stream: s, source: src }]);
|
|
1752
|
+
await store.commit(
|
|
1753
|
+
src,
|
|
1754
|
+
[inc(1)],
|
|
1755
|
+
make_meta({ stream: src })
|
|
1756
|
+
);
|
|
1757
|
+
const leases = await store.claim(5, 5, `w-${uid()}`, 5e3);
|
|
1758
|
+
const mine = leases.filter((l) => l.stream === s);
|
|
1759
|
+
(0, import_vitest9.expect)(mine).toHaveLength(1);
|
|
1760
|
+
(0, import_vitest9.expect)(mine[0].at).toBe(-1);
|
|
1761
|
+
const in_window = [];
|
|
1762
|
+
await store.query((e) => in_window.push(e), {
|
|
1763
|
+
stream: src,
|
|
1764
|
+
stream_exact: true,
|
|
1765
|
+
after: mine[0].at
|
|
1766
|
+
});
|
|
1767
|
+
(0, import_vitest9.expect)(in_window).toHaveLength(1);
|
|
1768
|
+
});
|
|
1741
1769
|
(0, import_vitest9.it)("keeps the maximum for negative and zero priorities too", async () => {
|
|
1742
1770
|
const s = `sub-pri-neg-${uid()}`;
|
|
1743
1771
|
const read = async () => {
|
|
@@ -2176,12 +2204,8 @@ var runStoreTck = (options) => {
|
|
|
2176
2204
|
const first = await fresh.claim(100, 0, `w-${uid()}`, 3e4);
|
|
2177
2205
|
const l1 = first.find((s) => s.stream === target);
|
|
2178
2206
|
(0, import_vitest9.expect)(l1).toBeDefined();
|
|
2179
|
-
|
|
2180
|
-
(
|
|
2181
|
-
await fresh.ack([
|
|
2182
|
-
{ ...l1, at: ea.id },
|
|
2183
|
-
{ ...c1, at: -1 }
|
|
2184
|
-
]);
|
|
2207
|
+
(0, import_vitest9.expect)(first.map((s) => s.stream)).not.toContain(control);
|
|
2208
|
+
await fresh.ack([{ ...l1, at: ea.id }]);
|
|
2185
2209
|
await seed_stream(fresh, other, 1);
|
|
2186
2210
|
const claimed = await fresh.claim(100, 0, `w-${uid()}`, 3e4);
|
|
2187
2211
|
const streams = claimed.map((s) => s.stream);
|