@luvio/adapter-test-library 0.126.2 → 0.128.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.
@@ -381,9 +381,11 @@ class MockDurableStore {
381
381
  finally {
382
382
  this.writePromises.delete(writePromise);
383
383
  }
384
+ const promises = [];
384
385
  this.listeners.forEach((listener) => {
385
- listener(changes);
386
+ promises.push(listener(changes));
386
387
  });
388
+ return Promise.all(promises).then();
387
389
  }
388
390
  async performOperation(operation) {
389
391
  const segment = operation.segment;
@@ -389,9 +389,11 @@
389
389
  finally {
390
390
  this.writePromises.delete(writePromise);
391
391
  }
392
+ const promises = [];
392
393
  this.listeners.forEach((listener) => {
393
- listener(changes);
394
+ promises.push(listener(changes));
394
395
  });
396
+ return Promise.all(promises).then();
395
397
  }
396
398
  async performOperation(operation) {
397
399
  const segment = operation.segment;
@@ -503,7 +503,7 @@
503
503
  };
504
504
  MockDurableStore.prototype.batchOperations = function (operations) {
505
505
  return __awaiter(this, void 0, void 0, function () {
506
- var changes, writePromise;
506
+ var changes, writePromise, promises;
507
507
  var _this = this;
508
508
  return __generator(this, function (_a) {
509
509
  switch (_a.label) {
@@ -549,10 +549,11 @@
549
549
  this.writePromises.delete(writePromise);
550
550
  return [7 /*endfinally*/];
551
551
  case 6:
552
+ promises = [];
552
553
  this.listeners.forEach(function (listener) {
553
- listener(changes);
554
+ promises.push(listener(changes));
554
555
  });
555
- return [2 /*return*/];
556
+ return [2 /*return*/, Promise.all(promises).then()];
556
557
  }
557
558
  });
558
559
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luvio/adapter-test-library",
3
- "version": "0.126.2",
3
+ "version": "0.128.0",
4
4
  "description": "Test library for luvio adapters",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,8 +21,8 @@
21
21
  "sinon": "^14.0.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@luvio/engine": "0.126.2",
25
- "@luvio/environments": "0.126.2",
24
+ "@luvio/engine": "0.128.0",
25
+ "@luvio/environments": "0.128.0",
26
26
  "@types/sinon": "^7.5.2"
27
27
  },
28
28
  "nx": {
@@ -100,9 +100,12 @@ export class MockDurableStore implements DurableStore {
100
100
  this.writePromises.delete(writePromise);
101
101
  }
102
102
 
103
+ const promises: Promise<void>[] = [];
103
104
  this.listeners.forEach((listener) => {
104
- listener(changes);
105
+ promises.push(listener(changes));
105
106
  });
107
+
108
+ return Promise.all(promises).then();
106
109
  }
107
110
 
108
111
  private async performOperation<T>(