feat: initial tm-core pre-cleanup

This commit is contained in:
Ralph Khreish
2025-08-22 14:28:01 +02:00
parent d5c2acc8bf
commit 281f556203
22 changed files with 572 additions and 289 deletions

View File

@@ -58,7 +58,10 @@ export class MockProvider extends BaseProvider {
throw new Error('Mock provider error');
}
if (this.options.failAfterAttempts && this.attemptCount <= this.options.failAfterAttempts) {
if (
this.options.failAfterAttempts &&
this.attemptCount <= this.options.failAfterAttempts
) {
if (this.options.simulateRateLimit) {
throw new Error('Rate limit exceeded - too many requests (429)');
}
@@ -200,6 +203,8 @@ export class MockProvider extends BaseProvider {
// Override retry configuration for testing
protected getMaxRetries(): number {
return this.options.failAfterAttempts ? this.options.failAfterAttempts + 1 : 3;
return this.options.failAfterAttempts
? this.options.failAfterAttempts + 1
: 3;
}
}