mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Move mockTool into test-utils (#7245)
This commit is contained in:
5
package-lock.json
generated
5
package-lock.json
generated
@@ -14225,6 +14225,7 @@
|
|||||||
"winston": "^3.17.0"
|
"winston": "^3.17.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@google/gemini-cli-test-utils": "file:../test-utils",
|
||||||
"@types/express": "^5.0.3",
|
"@types/express": "^5.0.3",
|
||||||
"@types/fs-extra": "^11.0.4",
|
"@types/fs-extra": "^11.0.4",
|
||||||
"@types/supertest": "^6.0.3",
|
"@types/supertest": "^6.0.3",
|
||||||
@@ -14788,7 +14789,9 @@
|
|||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.3.3"
|
"@google/gemini-cli-core": "file:../core",
|
||||||
|
"typescript": "^5.3.3",
|
||||||
|
"vitest": "^3.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/express": "^5.0.3",
|
"@types/express": "^5.0.3",
|
||||||
|
"@google/gemini-cli-test-utils": "file:../test-utils",
|
||||||
"@types/fs-extra": "^11.0.4",
|
"@types/fs-extra": "^11.0.4",
|
||||||
"@types/supertest": "^6.0.3",
|
"@types/supertest": "^6.0.3",
|
||||||
"@types/tar": "^6.1.13",
|
"@types/tar": "^6.1.13",
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import {
|
|||||||
assertTaskCreationAndWorkingStatus,
|
assertTaskCreationAndWorkingStatus,
|
||||||
createStreamMessageRequest,
|
createStreamMessageRequest,
|
||||||
} from './testing_utils.js';
|
} from './testing_utils.js';
|
||||||
import { MockTool } from '@google/gemini-cli-core';
|
import { MockTool } from '@google/gemini-cli-test-utils';
|
||||||
|
|
||||||
const mockToolConfirmationFn = async () =>
|
const mockToolConfirmationFn = async () =>
|
||||||
({}) as unknown as ToolCallConfirmationDetails;
|
({}) as unknown as ToolCallConfirmationDetails;
|
||||||
|
|||||||
@@ -25,13 +25,10 @@ import type {
|
|||||||
AnyDeclarativeTool,
|
AnyDeclarativeTool,
|
||||||
AnyToolInvocation,
|
AnyToolInvocation,
|
||||||
} from '@google/gemini-cli-core';
|
} from '@google/gemini-cli-core';
|
||||||
import {
|
import { ToolConfirmationOutcome, ApprovalMode } from '@google/gemini-cli-core';
|
||||||
ToolConfirmationOutcome,
|
|
||||||
ApprovalMode,
|
|
||||||
MockTool,
|
|
||||||
} from '@google/gemini-cli-core';
|
|
||||||
import type { HistoryItemWithoutId, HistoryItemToolGroup } from '../types.js';
|
import type { HistoryItemWithoutId, HistoryItemToolGroup } from '../types.js';
|
||||||
import { ToolCallStatus } from '../types.js';
|
import { ToolCallStatus } from '../types.js';
|
||||||
|
import { MockTool } from '@google/gemini-cli-test-utils';
|
||||||
|
|
||||||
// Mocks
|
// Mocks
|
||||||
vi.mock('@google/gemini-cli-core', async () => {
|
vi.mock('@google/gemini-cli-core', async () => {
|
||||||
|
|||||||
@@ -106,6 +106,3 @@ export * from './telemetry/index.js';
|
|||||||
export { sessionId } from './utils/session.js';
|
export { sessionId } from './utils/session.js';
|
||||||
export * from './utils/browser.js';
|
export * from './utils/browser.js';
|
||||||
export { Storage } from './config/storage.js';
|
export { Storage } from './config/storage.js';
|
||||||
|
|
||||||
// Export test utils
|
|
||||||
export * from './test-utils/index.js';
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
/**
|
|
||||||
* @license
|
|
||||||
* Copyright 2025 Google LLC
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
export * from './mock-tool.js';
|
|
||||||
@@ -4,4 +4,4 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './src/file-system-test-helpers.js';
|
export * from './src/index.js';
|
||||||
|
|||||||
@@ -10,7 +10,9 @@
|
|||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.3.3"
|
"typescript": "^5.3.3",
|
||||||
|
"@google/gemini-cli-core": "file:../core",
|
||||||
|
"vitest": "^3.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
|
|||||||
@@ -5,3 +5,4 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './file-system-test-helpers.js';
|
export * from './file-system-test-helpers.js';
|
||||||
|
export * from './mock-tool.js';
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ import type {
|
|||||||
ToolCallConfirmationDetails,
|
ToolCallConfirmationDetails,
|
||||||
ToolInvocation,
|
ToolInvocation,
|
||||||
ToolResult,
|
ToolResult,
|
||||||
} from '../tools/tools.js';
|
} from '@google/gemini-cli-core';
|
||||||
import {
|
import {
|
||||||
BaseDeclarativeTool,
|
BaseDeclarativeTool,
|
||||||
BaseToolInvocation,
|
BaseToolInvocation,
|
||||||
Kind,
|
Kind,
|
||||||
} from '../tools/tools.js';
|
} from '@google/gemini-cli-core';
|
||||||
|
|
||||||
type MockToolOptions = {
|
type MockToolOptions = {
|
||||||
name: string;
|
name: string;
|
||||||
Reference in New Issue
Block a user