@dudousxd/nestjs-durable-testing 0.21.0 → 0.22.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.d.ts CHANGED
@@ -317,4 +317,37 @@ declare function aggregationFixture(): StepCheckpoint[];
317
317
  */
318
318
  declare function registerCheckpointAggregationCases(t: (label: string, fn: () => Promise<void>) => void, getStore: () => StateStore, run: (over?: Partial<WorkflowRun>) => WorkflowRun): void;
319
319
 
320
- export { type AdmissionBackendFactory, DURABLE_CANONICAL_COLUMNS, type DurableColumnMap, type DurableColumnMismatch, type HandleableTransport, MutableClock, type RunHistory, type StateStoreContext, type StateStoreFactory, StateStoreUnavailableError, type TestEngine, aggregationFixture, assertDurableColumns, assertOutput, assertReplayable, assertRunStatus, assertStepAttempts, assertStepsRan, assertTransportConformance, captureHistory, createTestEngine, failOnce, failTimes, parseRunHistory, preserveColumnExpectation, recordedSteps, registerCheckpointAggregationCases, runAdmissionBackendContract, runStateStoreContract, serializeRunHistory };
320
+ /**
321
+ * Two transports on one broker (two instances of one deployment), isolated from every other case:
322
+ * a fresh prefix, table or queue per call. Both carry a run queue
323
+ * ({@link Transport.dispatchRuns} + {@link Transport.onDispatchedRun}).
324
+ */
325
+ interface RunDispatchHarness {
326
+ pair(): Promise<[Transport, Transport]>;
327
+ }
328
+ /**
329
+ * Builds the harness once per case, or returns a string: the reason the backend is unavailable
330
+ * (no Docker, say), which skips the case.
331
+ */
332
+ type RunDispatchHarnessFactory = () => Promise<RunDispatchHarness | string>;
333
+ interface RunDispatchContractOptions {
334
+ /** Per-case budget; a polling transport needs more. Default 30s. */
335
+ timeoutMs?: number;
336
+ /** Children in the fan cases. Default 300. */
337
+ fanSize?: number;
338
+ /**
339
+ * Whether a run already waiting in the queue is not queued a second time. Default true. False for
340
+ * an at-least-once queue without deduplication (an SQS standard queue): the contract then checks
341
+ * that a run received twice still runs one turn.
342
+ */
343
+ dedupesWaitingRuns?: boolean;
344
+ }
345
+ /**
346
+ * The contract of a transport's run queue: what `ctx.all` children, starts, re-dispatches and due
347
+ * timers rely on to spread over every instance of a deployment instead of executing on the one that
348
+ * triggered them. Registered as a vitest `describe`; every transport that carries a run queue runs
349
+ * it against its real backend.
350
+ */
351
+ declare function runRunDispatchContract(name: string, makeHarness: RunDispatchHarnessFactory, options?: RunDispatchContractOptions): void;
352
+
353
+ export { type AdmissionBackendFactory, DURABLE_CANONICAL_COLUMNS, type DurableColumnMap, type DurableColumnMismatch, type HandleableTransport, MutableClock, type RunDispatchContractOptions, type RunDispatchHarness, type RunDispatchHarnessFactory, type RunHistory, type StateStoreContext, type StateStoreFactory, StateStoreUnavailableError, type TestEngine, aggregationFixture, assertDurableColumns, assertOutput, assertReplayable, assertRunStatus, assertStepAttempts, assertStepsRan, assertTransportConformance, captureHistory, createTestEngine, failOnce, failTimes, parseRunHistory, preserveColumnExpectation, recordedSteps, registerCheckpointAggregationCases, runAdmissionBackendContract, runRunDispatchContract, runStateStoreContract, serializeRunHistory };