mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Remove unneeded mockRestore()s from tests (#919)
This commit is contained in:
@@ -214,8 +214,6 @@ describe('API Key Handling', () => {
|
||||
'Both GEMINI_API_KEY and GOOGLE_API_KEY are set. Using GOOGLE_API_KEY.',
|
||||
);
|
||||
expect(result.getApiKey()).toBe('google-key');
|
||||
|
||||
consoleWarnSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ describe('runNonInteractive', () => {
|
||||
let mockProcessExit: ReturnType<typeof vi.fn>;
|
||||
|
||||
beforeEach(() => {
|
||||
vi.resetAllMocks();
|
||||
mockChat = {
|
||||
sendMessageStream: vi.fn(),
|
||||
};
|
||||
@@ -201,7 +202,6 @@ describe('runNonInteractive', () => {
|
||||
expect(mockProcessStdoutWrite).toHaveBeenCalledWith(
|
||||
'Could not complete request.',
|
||||
);
|
||||
consoleErrorSpy.mockRestore();
|
||||
});
|
||||
|
||||
it('should exit with error if sendMessageStream throws initially', async () => {
|
||||
@@ -217,6 +217,5 @@ describe('runNonInteractive', () => {
|
||||
'Error processing input:',
|
||||
apiError,
|
||||
);
|
||||
consoleErrorSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -74,8 +74,7 @@ describe('loadGeminiIgnorePatterns', () => {
|
||||
if (actualFs.existsSync(tempDir)) {
|
||||
actualFs.rmSync(tempDir, { recursive: true, force: true });
|
||||
}
|
||||
consoleLogSpy.mockRestore();
|
||||
consoleWarnSpy.mockRestore();
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should load and parse patterns from .geminiignore, ignoring comments and empty lines', () => {
|
||||
|
||||
Reference in New Issue
Block a user