@rotorsoft/act-tck 1.2.0 → 1.3.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
@@ -1515,9 +1515,19 @@ var runStoreTck = (options) => {
1515
1515
  await store.drop();
1516
1516
  await store.seed();
1517
1517
  });
1518
- const asSource = (events) => (async function* () {
1519
- for (const e of events) yield e;
1520
- })();
1518
+ const asSource = (events) => ({
1519
+ async query(callback) {
1520
+ for (const e of events)
1521
+ await Promise.resolve(
1522
+ callback(
1523
+ e
1524
+ )
1525
+ );
1526
+ return events.length;
1527
+ },
1528
+ async dispose() {
1529
+ }
1530
+ });
1521
1531
  const event = (originalId, stream, version, name, created, data = {}) => ({
1522
1532
  id: originalId,
1523
1533
  name,
@@ -1533,6 +1543,7 @@ var runStoreTck = (options) => {
1533
1543
  try {
1534
1544
  return await app.restore(source, opts);
1535
1545
  } finally {
1546
+ await source.dispose();
1536
1547
  await cache.dispose();
1537
1548
  }
1538
1549
  };
@@ -1810,17 +1821,25 @@ var runStoreTck = (options) => {
1810
1821
  [inc(1), inc(2), inc(3)],
1811
1822
  makeMeta({ stream: original })
1812
1823
  );
1813
- const explosive = (async function* () {
1814
- yield event(
1815
- 1,
1816
- `restore-explode-${uid()}`,
1817
- 0,
1818
- "Incremented",
1819
- /* @__PURE__ */ new Date(),
1820
- { amount: 1 }
1821
- );
1822
- throw new Error("boom");
1823
- })();
1824
+ const explosive = {
1825
+ async query(callback) {
1826
+ await Promise.resolve(
1827
+ callback(
1828
+ event(
1829
+ 1,
1830
+ `restore-explode-${uid()}`,
1831
+ 0,
1832
+ "Incremented",
1833
+ /* @__PURE__ */ new Date(),
1834
+ { amount: 1 }
1835
+ )
1836
+ )
1837
+ );
1838
+ throw new Error("boom");
1839
+ },
1840
+ async dispose() {
1841
+ }
1842
+ };
1824
1843
  await expect3(restore(explosive)).rejects.toThrow("boom");
1825
1844
  const back = [];
1826
1845
  await store.query(