@rotorsoft/act-tck 1.28.5 → 1.29.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 +22 -0
- package/dist/@types/store-tck.d.ts.map +1 -1
- package/dist/index.cjs +39 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1077,6 +1077,45 @@ var runStoreTck = (options) => {
|
|
|
1077
1077
|
afterAll4(async () => {
|
|
1078
1078
|
await store.dispose();
|
|
1079
1079
|
});
|
|
1080
|
+
const default_factory = options.default_factory;
|
|
1081
|
+
if (default_factory) {
|
|
1082
|
+
describe8("default configuration", () => {
|
|
1083
|
+
it7("either refuses to construct or round-trips a commit", async () => {
|
|
1084
|
+
let zero_config;
|
|
1085
|
+
try {
|
|
1086
|
+
zero_config = await default_factory();
|
|
1087
|
+
} catch (error) {
|
|
1088
|
+
expect8(error).toBeInstanceOf(Error);
|
|
1089
|
+
expect8(error.message).not.toBe("");
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
try {
|
|
1093
|
+
await zero_config.seed();
|
|
1094
|
+
const s = `default-config-${uid()}`;
|
|
1095
|
+
const first = await zero_config.commit(
|
|
1096
|
+
s,
|
|
1097
|
+
[inc(1)],
|
|
1098
|
+
make_meta({ stream: s })
|
|
1099
|
+
);
|
|
1100
|
+
expect8(first[0].version).toBe(0);
|
|
1101
|
+
const second = await zero_config.commit(
|
|
1102
|
+
s,
|
|
1103
|
+
[inc(2)],
|
|
1104
|
+
make_meta({ stream: s })
|
|
1105
|
+
);
|
|
1106
|
+
expect8(second[0].version).toBe(1);
|
|
1107
|
+
const read = [];
|
|
1108
|
+
await zero_config.query((e) => read.push(e), {
|
|
1109
|
+
stream: s
|
|
1110
|
+
});
|
|
1111
|
+
expect8(read).toHaveLength(2);
|
|
1112
|
+
expect8(read.map((e) => e.data.amount)).toEqual([1, 2]);
|
|
1113
|
+
} finally {
|
|
1114
|
+
await zero_config.dispose();
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1080
1119
|
describe8("commit", () => {
|
|
1081
1120
|
it7("returns committed events with sequenced ids and versions", async () => {
|
|
1082
1121
|
const s = `commit-seq-${uid()}`;
|