mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 13:04:49 -07:00
Refactor: Introduce InteractiveRun class (#10947)
This commit is contained in:
committed by
GitHub
parent
09ef33ec3a
commit
5dc7059ba3
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { expect, describe, it, beforeEach, afterEach } from 'vitest';
|
||||
import { TestRig, type } from './test-helper.js';
|
||||
import { TestRig } from './test-helper.js';
|
||||
|
||||
describe('Interactive Mode', () => {
|
||||
let rig: TestRig;
|
||||
@@ -21,20 +21,20 @@ describe('Interactive Mode', () => {
|
||||
it('should trigger chat compression with /compress command', async () => {
|
||||
await rig.setup('interactive-compress-test');
|
||||
|
||||
const ptyProcess = await rig.runInteractive();
|
||||
const run = await rig.runInteractive();
|
||||
|
||||
const longPrompt =
|
||||
'Dont do anything except returning a 1000 token long paragragh with the <name of the scientist who discovered theory of relativity> at the end to indicate end of response. This is a moderately long sentence.';
|
||||
|
||||
await type(ptyProcess, longPrompt);
|
||||
await type(ptyProcess, '\r');
|
||||
await run.type(longPrompt);
|
||||
await run.type('\r');
|
||||
|
||||
await rig.waitForText('einstein', 25000);
|
||||
await run.waitForText('einstein', 25000);
|
||||
|
||||
await type(ptyProcess, '/compress');
|
||||
await run.type('/compress');
|
||||
// A small delay to allow React to re-render the command list.
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
await type(ptyProcess, '\r');
|
||||
await run.type('\r');
|
||||
|
||||
const foundEvent = await rig.waitForTelemetryEvent(
|
||||
'chat_compression',
|
||||
@@ -49,12 +49,11 @@ describe('Interactive Mode', () => {
|
||||
it.skip('should handle compression failure on token inflation', async () => {
|
||||
await rig.setup('interactive-compress-test');
|
||||
|
||||
const ptyProcess = await rig.runInteractive();
|
||||
const run = await rig.runInteractive();
|
||||
|
||||
await type(ptyProcess, '/compress');
|
||||
await run.type('/compress');
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
await type(ptyProcess, '\r');
|
||||
|
||||
await rig.waitForText('compression was not beneficial', 25000);
|
||||
await run.type('\r');
|
||||
await run.waitForText('compression was not beneficial', 25000);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user