mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-07 07:59:42 +02:00
fix: resolve 11 failing tests across 8 test files
- ralph-tracker: add ✓ to native todo pattern + pre-check, add configure() method - session: remove stale message expectation from interactive endpoint test - buffer-management: fix trim count expectations (1202 items triggers second trim) - cli-commands: replace non-existent toStartWith with toMatch regex - edge-cases: update error expectation for session-not-found on respawn config PUT - ralph-integration: respawn config PUT without controller now saves as pre-config - session-state: fix debouncer shouldFlush(0) - pass timestamp >= delayMs - timing-utilities: attach catch handlers before advancing fake timers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -196,11 +196,12 @@ describe('Timing Utilities', () => {
|
||||
const fn = vi.fn().mockRejectedValue(new Error('always fails'));
|
||||
|
||||
const promise = retryWithBackoff(fn, 2, 100);
|
||||
const expectation = expect(promise).rejects.toThrow('always fails');
|
||||
|
||||
await vi.advanceTimersByTimeAsync(100); // First retry
|
||||
await vi.advanceTimersByTimeAsync(200); // Second retry
|
||||
|
||||
await expect(promise).rejects.toThrow('always fails');
|
||||
await expectation;
|
||||
expect(fn).toHaveBeenCalledTimes(3); // Initial + 2 retries
|
||||
});
|
||||
});
|
||||
@@ -245,9 +246,9 @@ describe('Timing Utilities', () => {
|
||||
);
|
||||
|
||||
const wrapped = withTimeout(promise, 100);
|
||||
const expectation = expect(wrapped).rejects.toThrow('Operation timed out');
|
||||
await vi.advanceTimersByTimeAsync(100);
|
||||
|
||||
await expect(wrapped).rejects.toThrow('Operation timed out');
|
||||
await expectation;
|
||||
});
|
||||
|
||||
it('should use custom timeout message', async () => {
|
||||
@@ -256,9 +257,9 @@ describe('Timing Utilities', () => {
|
||||
);
|
||||
|
||||
const wrapped = withTimeout(promise, 100, 'Custom message');
|
||||
const expectation = expect(wrapped).rejects.toThrow('Custom message');
|
||||
await vi.advanceTimersByTimeAsync(100);
|
||||
|
||||
await expect(wrapped).rejects.toThrow('Custom message');
|
||||
await expectation;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user