mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-07 20:00:37 -07:00
Disallow floating promises. (#14605)
This commit is contained in:
committed by
GitHub
parent
3cf44acc08
commit
025e450ac2
@@ -645,12 +645,14 @@ describe('KeypressContext', () => {
|
||||
expect(keyHandler).not.toHaveBeenCalled();
|
||||
|
||||
// Advance time just before timeout
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
act(() => vi.advanceTimersByTime(ESC_TIMEOUT - 5));
|
||||
|
||||
// Still shouldn't broadcast
|
||||
expect(keyHandler).not.toHaveBeenCalled();
|
||||
|
||||
// Advance past timeout
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
act(() => vi.advanceTimersByTime(10));
|
||||
|
||||
// Should now broadcast the incomplete sequence as regular input
|
||||
@@ -789,12 +791,14 @@ describe('KeypressContext', () => {
|
||||
act(() => stdin.write('\x1b[97;13'));
|
||||
|
||||
// Advance time partway
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
act(() => vi.advanceTimersByTime(30));
|
||||
|
||||
// Add more to sequence
|
||||
act(() => stdin.write('5'));
|
||||
|
||||
// Advance time from the first timeout point
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
act(() => vi.advanceTimersByTime(25));
|
||||
|
||||
// Should not have timed out yet (timeout restarted)
|
||||
@@ -878,6 +882,7 @@ describe('KeypressContext', () => {
|
||||
act(() => stdin.write('\x1b[<'));
|
||||
|
||||
// Advance time past the normal kitty timeout (50ms)
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
act(() => vi.advanceTimersByTime(ESC_TIMEOUT + 10));
|
||||
|
||||
// Send the rest
|
||||
@@ -930,6 +935,8 @@ describe('KeypressContext', () => {
|
||||
|
||||
for (const char of sequence) {
|
||||
act(() => stdin.write(char));
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
act(() => vi.advanceTimersByTime(0));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user