@rotorsoft/act-tck 1.38.14 → 1.38.16
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 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -7
package/dist/index.js
CHANGED
|
@@ -1246,6 +1246,20 @@ var runStoreTck = (options) => {
|
|
|
1246
1246
|
store.commit(s, [inc(1)], make_meta({ stream: s }), 0)
|
|
1247
1247
|
).rejects.toBeInstanceOf(ConcurrencyError);
|
|
1248
1248
|
});
|
|
1249
|
+
it7("checks expectedVersion even when committing no events", async () => {
|
|
1250
|
+
const s = `commit-empty-cc-${uid()}`;
|
|
1251
|
+
await store.commit(
|
|
1252
|
+
s,
|
|
1253
|
+
[inc(1)],
|
|
1254
|
+
make_meta({ stream: s })
|
|
1255
|
+
);
|
|
1256
|
+
await expect8(
|
|
1257
|
+
store.commit(s, [], make_meta({ stream: s }), 5)
|
|
1258
|
+
).rejects.toBeInstanceOf(ConcurrencyError);
|
|
1259
|
+
expect8(
|
|
1260
|
+
await store.commit(s, [], make_meta({ stream: s }), 0)
|
|
1261
|
+
).toEqual([]);
|
|
1262
|
+
});
|
|
1249
1263
|
it7("preserves prior events when a concurrent commit is rejected", async () => {
|
|
1250
1264
|
const s = `commit-cc-preserve-${uid()}`;
|
|
1251
1265
|
await store.commit(
|
|
@@ -1672,6 +1686,22 @@ var runStoreTck = (options) => {
|
|
|
1672
1686
|
if (error !== void 0) expect8(error).toBeInstanceOf(ValidationError);
|
|
1673
1687
|
else expect8(matched).toEqual(expected.sort());
|
|
1674
1688
|
};
|
|
1689
|
+
it7("treats an empty-string stream filter as a regex that matches everything", async () => {
|
|
1690
|
+
const tag = uid();
|
|
1691
|
+
const a = `empty-${tag}-a`;
|
|
1692
|
+
const source = `empty-src-${tag}`;
|
|
1693
|
+
await store.subscribe([{ stream: a, source }]);
|
|
1694
|
+
const seen = [];
|
|
1695
|
+
await store.query_streams((p) => seen.push(p.stream), {
|
|
1696
|
+
stream: "",
|
|
1697
|
+
source,
|
|
1698
|
+
source_exact: true
|
|
1699
|
+
});
|
|
1700
|
+
expect8(seen).toEqual([a]);
|
|
1701
|
+
expect8(
|
|
1702
|
+
await store.reset({ stream: "", source, source_exact: true })
|
|
1703
|
+
).toBe(1);
|
|
1704
|
+
});
|
|
1675
1705
|
it7("portable subset: anchors, `.`, and `.*` match identically", async () => {
|
|
1676
1706
|
const tag = uid();
|
|
1677
1707
|
const plain = `g-${tag}-plain`;
|