fix(test) - Make JSON output error test use canned response (#12250)

Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com>
This commit is contained in:
shishu314
2025-10-30 13:25:01 -04:00
committed by GitHub
parent b8969cceff
commit d4cad0cdcc
2 changed files with 11 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
import { expect, describe, it, beforeEach, afterEach } from 'vitest';
import { TestRig } from './test-helper.js';
import { join } from 'node:path';
describe('JSON output', () => {
let rig: TestRig;
@@ -87,7 +88,13 @@ describe('JSON output', () => {
expect(payload.error.message).toContain("current type is 'oauth-personal'");
});
it.skip('should not exit on tool errors and allow model to self-correct in JSON mode', async () => {
it('should not exit on tool errors and allow model to self-correct in JSON mode', async () => {
rig.setup('json-output-error', {
fakeResponsesPath: join(
import.meta.dirname,
'json-output.error.responses',
),
});
const result = await rig.run(
`Read the contents of ${rig.testDir}/path/to/nonexistent/file.txt and tell me what it says. ` +
'On error, respond to the user with exactly the text "File not found".',