@dudousxd/nestjs-durable-testing 0.7.0 → 0.7.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/index.js CHANGED
@@ -566,6 +566,14 @@ function runStateStoreContract(name, makeStore) {
566
566
  expect2(r?.lockedBy).toBe("owner-2");
567
567
  expect2(r?.wakeAt).toBe(123456);
568
568
  expect2(r?.lockedUntil).toBe(222222);
569
+ await store.updateRun("r1", {
570
+ awaitingDecisionTaskId: "turn-7"
571
+ });
572
+ expect2((await store.getRun("r1"))?.awaitingDecisionTaskId).toBe("turn-7");
573
+ await store.updateRun("r1", {
574
+ awaitingDecisionTaskId: void 0
575
+ });
576
+ expect2((await store.getRun("r1"))?.awaitingDecisionTaskId).toBeUndefined();
569
577
  });
570
578
  t("upserts checkpoints, reads them by (runId, seq), and lists them ordered by seq", async () => {
571
579
  await store.createRun(run());
@@ -1145,6 +1153,24 @@ function runStateStoreContract(name, makeStore) {
1145
1153
  expect2((await store.takeSignalWaiter("approve-1"))?.seq).toBe(3);
1146
1154
  expect2(await store.takeSignalWaiter("approve-1")).toBeNull();
1147
1155
  });
1156
+ t("round-trips a signal waiter parallelGroup (child-fan tag) through put \u2192 take \u2192 list", async () => {
1157
+ await store.putSignalWaiter({
1158
+ token: "child:r.child.0",
1159
+ runId: "r",
1160
+ seq: 0,
1161
+ parallelGroup: "gather:0"
1162
+ });
1163
+ await store.putSignalWaiter({
1164
+ token: "child:r.child.9",
1165
+ runId: "r",
1166
+ seq: 9
1167
+ });
1168
+ const listed = await store.listSignalWaiters("child:");
1169
+ expect2(listed.find((w) => w.token === "child:r.child.0")?.parallelGroup).toBe("gather:0");
1170
+ expect2(listed.find((w) => w.token === "child:r.child.9")?.parallelGroup).toBeUndefined();
1171
+ expect2((await store.takeSignalWaiter("child:r.child.0"))?.parallelGroup).toBe("gather:0");
1172
+ expect2((await store.takeSignalWaiter("child:r.child.9"))?.parallelGroup).toBeUndefined();
1173
+ });
1148
1174
  t("buffers signals and takes them FIFO per token", async () => {
1149
1175
  await store.bufferSignal("sig", {
1150
1176
  n: 1