mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
test: fix failed test cases and restore vitest.config.ts
This commit is contained in:
@@ -686,6 +686,9 @@ describe('CoreToolScheduler with payload', () => {
|
|||||||
getUseSmartEdit: () => false,
|
getUseSmartEdit: () => false,
|
||||||
getUseModelRouter: () => false,
|
getUseModelRouter: () => false,
|
||||||
getGeminiClient: () => null, // No client needed for these tests
|
getGeminiClient: () => null, // No client needed for these tests
|
||||||
|
isInteractive: () => true, // Required to prevent auto-denial of tool calls
|
||||||
|
getIdeMode: () => false,
|
||||||
|
getExperimentalZedIntegration: () => false,
|
||||||
} as unknown as Config;
|
} as unknown as Config;
|
||||||
|
|
||||||
const scheduler = new CoreToolScheduler({
|
const scheduler = new CoreToolScheduler({
|
||||||
@@ -1006,6 +1009,9 @@ describe('CoreToolScheduler edit cancellation', () => {
|
|||||||
getUseSmartEdit: () => false,
|
getUseSmartEdit: () => false,
|
||||||
getUseModelRouter: () => false,
|
getUseModelRouter: () => false,
|
||||||
getGeminiClient: () => null, // No client needed for these tests
|
getGeminiClient: () => null, // No client needed for these tests
|
||||||
|
isInteractive: () => true, // Required to prevent auto-denial of tool calls
|
||||||
|
getIdeMode: () => false,
|
||||||
|
getExperimentalZedIntegration: () => false,
|
||||||
} as unknown as Config;
|
} as unknown as Config;
|
||||||
|
|
||||||
const scheduler = new CoreToolScheduler({
|
const scheduler = new CoreToolScheduler({
|
||||||
@@ -1658,6 +1664,9 @@ describe('CoreToolScheduler request queueing', () => {
|
|||||||
getUseSmartEdit: () => false,
|
getUseSmartEdit: () => false,
|
||||||
getUseModelRouter: () => false,
|
getUseModelRouter: () => false,
|
||||||
getGeminiClient: () => null, // No client needed for these tests
|
getGeminiClient: () => null, // No client needed for these tests
|
||||||
|
isInteractive: () => true, // Required to prevent auto-denial of tool calls
|
||||||
|
getIdeMode: () => false,
|
||||||
|
getExperimentalZedIntegration: () => false,
|
||||||
} as unknown as Config;
|
} as unknown as Config;
|
||||||
|
|
||||||
const testTool = new TestApprovalTool(mockConfig);
|
const testTool = new TestApprovalTool(mockConfig);
|
||||||
@@ -1687,7 +1696,10 @@ describe('CoreToolScheduler request queueing', () => {
|
|||||||
const onAllToolCallsComplete = vi.fn();
|
const onAllToolCallsComplete = vi.fn();
|
||||||
const onToolCallsUpdate = vi.fn();
|
const onToolCallsUpdate = vi.fn();
|
||||||
const pendingConfirmations: Array<
|
const pendingConfirmations: Array<
|
||||||
(outcome: ToolConfirmationOutcome) => void
|
(
|
||||||
|
outcome: ToolConfirmationOutcome,
|
||||||
|
payload?: ToolConfirmationPayload,
|
||||||
|
) => Promise<void>
|
||||||
> = [];
|
> = [];
|
||||||
|
|
||||||
const scheduler = new CoreToolScheduler({
|
const scheduler = new CoreToolScheduler({
|
||||||
@@ -1758,7 +1770,7 @@ describe('CoreToolScheduler request queueing', () => {
|
|||||||
|
|
||||||
// Approve the first tool with ProceedAlways
|
// Approve the first tool with ProceedAlways
|
||||||
const firstConfirmation = pendingConfirmations[0];
|
const firstConfirmation = pendingConfirmations[0];
|
||||||
firstConfirmation(ToolConfirmationOutcome.ProceedAlways);
|
await firstConfirmation(ToolConfirmationOutcome.ProceedAlways);
|
||||||
|
|
||||||
// Wait for all tools to be completed
|
// Wait for all tools to be completed
|
||||||
await vi.waitFor(() => {
|
await vi.waitFor(() => {
|
||||||
|
|||||||
13
vitest.config.ts
Normal file
13
vitest.config.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
projects: [
|
||||||
|
'packages/cli',
|
||||||
|
'packages/core',
|
||||||
|
'packages/vscode-ide-companion',
|
||||||
|
'integration-tests',
|
||||||
|
'scripts',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user