@plyaz/types 1.4.1 → 1.5.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/testing/common/factories/types.d.ts +78 -34
- package/dist/testing/common/mocks/types.d.ts +456 -202
- package/dist/testing/common/patterns/types.d.ts +19 -2
- package/dist/testing/common/utils/types.d.ts +1221 -31
- package/dist/testing/features/cache/types.d.ts +129 -1
- package/dist/testing/features/feature-flags/types.d.ts +203 -41
- package/package.json +1 -1
|
@@ -333,7 +333,7 @@ export interface CreateBatchProcessorReturn<T> {
|
|
|
333
333
|
*/
|
|
334
334
|
export interface CreateBatchTestHelperReturn<T> {
|
|
335
335
|
generateOperations(count: number, distribution?: Partial<Record<OperationType, number>>): Operation<T>[];
|
|
336
|
-
simulateFailures(processor: Vitest.
|
|
336
|
+
simulateFailures(processor: Vitest.MockInstance, failureRate: number, error?: Error): void;
|
|
337
337
|
assertBatchResult(result: BatchOperationResult<T>, expectations: {
|
|
338
338
|
minSuccessRate?: number;
|
|
339
339
|
maxDuration?: number;
|
|
@@ -390,7 +390,7 @@ export interface CreateBatchTestHelperReturn<T> {
|
|
|
390
390
|
* ```
|
|
391
391
|
*/
|
|
392
392
|
export interface CreateMockBatchHandlerReturn<T> {
|
|
393
|
-
handler: Vitest.
|
|
393
|
+
handler: Vitest.MockInstance<(operation: Operation<T>) => Promise<T>>;
|
|
394
394
|
getProcessedOperations: () => Operation<T>[];
|
|
395
395
|
getResults: () => Map<string, T>;
|
|
396
396
|
clear: () => void;
|
|
@@ -572,3 +572,20 @@ export interface StressTestConfig {
|
|
|
572
572
|
concurrency?: number;
|
|
573
573
|
operationMix?: Record<string, number>;
|
|
574
574
|
}
|
|
575
|
+
/**
|
|
576
|
+
* Process with retry parameters
|
|
577
|
+
* @interface ProcessWithRetryParams
|
|
578
|
+
* @typeParam T - Type of operation data
|
|
579
|
+
*/
|
|
580
|
+
export interface ProcessWithRetryParams<T> {
|
|
581
|
+
/** Operation to process */
|
|
582
|
+
operation: unknown;
|
|
583
|
+
/** Processing function */
|
|
584
|
+
processFn: (operation: unknown) => Promise<T> | T;
|
|
585
|
+
/** Number of retry attempts */
|
|
586
|
+
retryCount: number;
|
|
587
|
+
/** Delay between retries */
|
|
588
|
+
retryDelay: number;
|
|
589
|
+
/** Operation timeout */
|
|
590
|
+
timeout: number;
|
|
591
|
+
}
|