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

View File

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

View File

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