@plyaz/types 1.5.1 → 1.5.3
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/features/feature-flag/types.d.ts +28 -4
- package/dist/testing/common/factories/types.d.ts +92 -56
- package/dist/testing/common/mocks/types.d.ts +608 -377
- package/dist/testing/common/patterns/types.d.ts +28 -10
- package/dist/testing/common/utils/types.d.ts +2995 -618
- package/dist/testing/features/cache/types.d.ts +127 -54
- package/dist/testing/features/feature-flags/types.d.ts +249 -128
- 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.Mock, 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.Mock<(operation: Operation<T>) => Promise<T>>;
|
|
394
394
|
getProcessedOperations: () => Operation<T>[];
|
|
395
395
|
getResults: () => Map<string, T>;
|
|
396
396
|
clear: () => void;
|
|
@@ -573,19 +573,37 @@ export interface StressTestConfig {
|
|
|
573
573
|
operationMix?: Record<string, number>;
|
|
574
574
|
}
|
|
575
575
|
/**
|
|
576
|
-
*
|
|
577
|
-
*
|
|
578
|
-
*
|
|
576
|
+
* Parameters for processing operations with retry logic.
|
|
577
|
+
* Configures retry behavior for resilient operation execution.
|
|
578
|
+
*
|
|
579
|
+
* @template T - Type of operation data
|
|
580
|
+
*
|
|
581
|
+
* @example
|
|
582
|
+
* ```typescript
|
|
583
|
+
* const params: ProcessWithRetryParams<UserData> = {
|
|
584
|
+
* operation: {
|
|
585
|
+
* id: 'op-123',
|
|
586
|
+
* type: 'create',
|
|
587
|
+
* data: { name: 'John', email: 'john@example.com' }
|
|
588
|
+
* },
|
|
589
|
+
* processFn: async (op) => {
|
|
590
|
+
* return await apiClient.createUser(op.data);
|
|
591
|
+
* },
|
|
592
|
+
* retryCount: 3,
|
|
593
|
+
* retryDelay: 1000,
|
|
594
|
+
* timeout: 5000
|
|
595
|
+
* };
|
|
596
|
+
* ```
|
|
579
597
|
*/
|
|
580
598
|
export interface ProcessWithRetryParams<T> {
|
|
581
599
|
/** Operation to process */
|
|
582
|
-
operation:
|
|
583
|
-
/**
|
|
584
|
-
processFn: (operation:
|
|
600
|
+
operation: Operation<T>;
|
|
601
|
+
/** Function to process the operation */
|
|
602
|
+
processFn: (operation: Operation<T>) => Promise<T> | T;
|
|
585
603
|
/** Number of retry attempts */
|
|
586
604
|
retryCount: number;
|
|
587
|
-
/** Delay between retries */
|
|
605
|
+
/** Delay between retries in milliseconds */
|
|
588
606
|
retryDelay: number;
|
|
589
|
-
/** Operation timeout */
|
|
607
|
+
/** Operation timeout in milliseconds */
|
|
590
608
|
timeout: number;
|
|
591
609
|
}
|