Update editor.ts (#1371)

This commit is contained in:
cornmander 2025-06-24 02:41:40 -04:00 committed by GitHub
parent 324715ee8b
commit a2ed4266aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ describe('EditTool', () => {
.fn()
.mockReturnValue(mockClientInstanceWithGenerateJson),
getTargetDir: () => rootDir,
getApprovalMode: vi.fn(() => false),
getApprovalMode: vi.fn(),
setApprovalMode: vi.fn(),
// getGeminiConfig: () => ({ apiKey: 'test-api-key' }), // This was not a real Config method
// Add other properties/methods of Config if EditTool uses them
@ -79,7 +79,6 @@ describe('EditTool', () => {
// Reset mocks before each test
(mockConfig.getApprovalMode as Mock).mockClear();
(mockConfig.getApprovalMode as Mock).mockClear();
// Default to not skipping confirmation
(mockConfig.getApprovalMode as Mock).mockReturnValue(ApprovalMode.DEFAULT);
@ -335,7 +334,6 @@ describe('EditTool', () => {
let mockCalled = false;
mockEnsureCorrectEdit.mockImplementationOnce(
async (content, p, client) => {
console.log('mockEnsureCorrectEdit CALLED IN TEST');
mockCalled = true;
expect(content).toBe(originalContent);
expect(p).toBe(params);

View File

@ -189,6 +189,7 @@ describe('editor utils', () => {
diffCommand.args,
{
stdio: 'inherit',
shell: true,
},
);
expect(mockSpawn.on).toHaveBeenCalledWith(

View File

@ -145,6 +145,7 @@ export async function openDiff(
return new Promise((resolve, reject) => {
const childProcess = spawn(diffCommand.command, diffCommand.args, {
stdio: 'inherit',
shell: true,
});
childProcess.on('close', (code) => {