Update editor.ts (#1371)
This commit is contained in:
parent
324715ee8b
commit
a2ed4266aa
|
@ -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);
|
||||
|
|
|
@ -189,6 +189,7 @@ describe('editor utils', () => {
|
|||
diffCommand.args,
|
||||
{
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
},
|
||||
);
|
||||
expect(mockSpawn.on).toHaveBeenCalledWith(
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue