mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 15:31:27 +00:00
fix ci test
This commit is contained in:
parent
3d1fc7ab78
commit
6dc06cc34e
1 changed files with 35 additions and 23 deletions
|
|
@ -392,34 +392,46 @@ describe('clipboardUtils', () => {
|
|||
describe('error handling with DEBUG mode', () => {
|
||||
const originalEnv = process.env;
|
||||
|
||||
beforeEach(() => {
|
||||
vi.stubGlobal('process', {
|
||||
...process,
|
||||
platform: 'darwin',
|
||||
env: { ...originalEnv, DEBUG: '1' },
|
||||
describe('clipboardHasImage', () => {
|
||||
beforeEach(() => {
|
||||
vi.stubGlobal('process', {
|
||||
...process,
|
||||
platform: 'darwin',
|
||||
env: { ...originalEnv, DEBUG: '1' },
|
||||
});
|
||||
});
|
||||
|
||||
it('should log errors in DEBUG mode', async () => {
|
||||
const consoleErrorSpy = vi
|
||||
.spyOn(console, 'error')
|
||||
.mockImplementation(() => {});
|
||||
mockExecCommand.mockRejectedValue(new Error('Test error'));
|
||||
|
||||
await clipboardHasImage();
|
||||
expect(consoleErrorSpy).toHaveBeenCalled();
|
||||
consoleErrorSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
it('should log errors in DEBUG mode for clipboardHasImage', async () => {
|
||||
const consoleErrorSpy = vi
|
||||
.spyOn(console, 'error')
|
||||
.mockImplementation(() => {});
|
||||
mockExecCommand.mockRejectedValue(new Error('Test error'));
|
||||
describe('saveClipboardImage on Windows', () => {
|
||||
beforeEach(() => {
|
||||
vi.stubGlobal('process', {
|
||||
...process,
|
||||
platform: 'win32',
|
||||
env: { ...originalEnv, DEBUG: '1' },
|
||||
});
|
||||
});
|
||||
|
||||
await clipboardHasImage();
|
||||
expect(consoleErrorSpy).toHaveBeenCalled();
|
||||
consoleErrorSpy.mockRestore();
|
||||
});
|
||||
it('should log errors in DEBUG mode', async () => {
|
||||
const consoleErrorSpy = vi
|
||||
.spyOn(console, 'error')
|
||||
.mockImplementation(() => {});
|
||||
mockExecCommand.mockRejectedValue(new Error('Test error'));
|
||||
|
||||
it('should log errors in DEBUG mode for saveClipboardImage', async () => {
|
||||
const consoleErrorSpy = vi
|
||||
.spyOn(console, 'error')
|
||||
.mockImplementation(() => {});
|
||||
mockExecCommand.mockRejectedValue(new Error('Test error'));
|
||||
|
||||
await saveClipboardImage('/invalid/path');
|
||||
expect(consoleErrorSpy).toHaveBeenCalled();
|
||||
consoleErrorSpy.mockRestore();
|
||||
await saveClipboardImage('/invalid/path');
|
||||
expect(consoleErrorSpy).toHaveBeenCalled();
|
||||
consoleErrorSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue