@dudousxd/nestjs-durable-testing 0.25.0 → 0.25.1
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 +41 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2929,6 +2929,47 @@ function runStateStoreContract(name, makeStore) {
|
|
|
2929
2929
|
message: "boom"
|
|
2930
2930
|
});
|
|
2931
2931
|
expect3(failed?.startedAt.getTime()).toBe(at.getTime());
|
|
2932
|
+
await store.saveCheckpoint(pending("r1", 4));
|
|
2933
|
+
const events = [
|
|
2934
|
+
{
|
|
2935
|
+
at: 2,
|
|
2936
|
+
level: "info",
|
|
2937
|
+
message: "started"
|
|
2938
|
+
},
|
|
2939
|
+
{
|
|
2940
|
+
at: 3,
|
|
2941
|
+
level: "info",
|
|
2942
|
+
message: "done"
|
|
2943
|
+
}
|
|
2944
|
+
];
|
|
2945
|
+
const [arrays] = await store.settleResultsIfPending([
|
|
2946
|
+
{
|
|
2947
|
+
runId: "r1",
|
|
2948
|
+
seq: 4,
|
|
2949
|
+
status: "completed",
|
|
2950
|
+
output: [
|
|
2951
|
+
{
|
|
2952
|
+
row: 1
|
|
2953
|
+
},
|
|
2954
|
+
{
|
|
2955
|
+
row: 2
|
|
2956
|
+
}
|
|
2957
|
+
],
|
|
2958
|
+
events,
|
|
2959
|
+
finishedAt: later
|
|
2960
|
+
}
|
|
2961
|
+
]);
|
|
2962
|
+
expect3(arrays?.status).toBe("completed");
|
|
2963
|
+
expect3(arrays?.output).toEqual([
|
|
2964
|
+
{
|
|
2965
|
+
row: 1
|
|
2966
|
+
},
|
|
2967
|
+
{
|
|
2968
|
+
row: 2
|
|
2969
|
+
}
|
|
2970
|
+
]);
|
|
2971
|
+
expect3(arrays?.events).toEqual(events);
|
|
2972
|
+
expect3((await store.getCheckpoint("r1", 4))?.events).toEqual(events);
|
|
2932
2973
|
const stored = await store.getCheckpoint("r1", 0);
|
|
2933
2974
|
expect3(stored?.output).toEqual({
|
|
2934
2975
|
n: 0
|