mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 20:14:44 -07:00
test: fix flaky integration tests for compress command (#10371)
Co-authored-by: Taneja Hriday <hridayt@google.com> Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -140,13 +140,14 @@ describe('replace', () => {
|
||||
it('should insert a multi-line block of text', async () => {
|
||||
const rig = new TestRig();
|
||||
await rig.setup('should insert a multi-line block of text');
|
||||
const fileName = 'insert_block.js';
|
||||
const originalContent = 'function hello() {\n // INSERT_CODE_HERE\n}';
|
||||
const newBlock = "console.log('hello');\n console.log('world');";
|
||||
const expectedContent = `function hello() {\n ${newBlock}\n}`;
|
||||
const fileName = 'insert_block.txt';
|
||||
const originalContent = 'Line A\n<INSERT_TEXT_HERE>\nLine C';
|
||||
const newBlock = 'First line\nSecond line\nThird line';
|
||||
const expectedContent =
|
||||
'Line A\nFirst line\nSecond line\nThird line\nLine C';
|
||||
rig.createFile(fileName, originalContent);
|
||||
|
||||
const prompt = `In ${fileName}, replace "// INSERT_CODE_HERE" with:\n${newBlock}`;
|
||||
const prompt = `In ${fileName}, replace "<INSERT_TEXT_HERE>" with:\n${newBlock}`;
|
||||
const result = await rig.run(prompt);
|
||||
|
||||
const foundToolCall = await rig.waitForToolCall('replace');
|
||||
|
||||
Reference in New Issue
Block a user