mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
sqlQueryTool (execute_sql) was listed in BUILTIN_TOOL_CATALOG and available in the CLI AGENT_TOOL_REGISTRY, but was never imported or registered in the Electron-specific TOOL_REGISTRY. Users who enabled the tool via the assistant config panel would trigger a missing-tool error at inference time. Add sqlQueryTool to the Electron registry following the same adaptSharedTool pattern used by all other analysis tools. Add a catalog/registry drift guard test (name + category) covering all BUILTIN_TOOL_CATALOG entries, enabled via --experimental-test-module-mocks to mock Electron runtime deps. Document the general-over-specific assertion rule in AGENTS.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
import assert from 'node:assert/strict'
|
|
import test from 'node:test'
|
|
|
|
import { buildNodeTestArgs, filterDefaultTestFiles } from './run-tests.mjs'
|
|
|
|
test('default test collection excludes e2e, smoke, and real external tests', () => {
|
|
const files = [
|
|
'apps/cli/src/ai/chat-command.test.ts',
|
|
'tests/chart-runtime/agent-chart-flow.test.mts',
|
|
'tests/chart-runtime/render-chart.integration.test.ts',
|
|
'tests/e2e/helpers/app-launcher.test.js',
|
|
'tests/e2e/smoke/chart-runtime.smoke.test.js',
|
|
'tests/chart-runtime/real-llm-chart-flow.e2e.test.ts',
|
|
'tests/e2e/helpers/app-launcher.js',
|
|
]
|
|
|
|
assert.deepEqual(filterDefaultTestFiles(files), [
|
|
'apps/cli/src/ai/chat-command.test.ts',
|
|
'tests/chart-runtime/agent-chart-flow.test.mts',
|
|
'tests/chart-runtime/render-chart.integration.test.ts',
|
|
])
|
|
})
|
|
|
|
test('explicit test arguments are passed through without default exclusions', () => {
|
|
assert.deepEqual(buildNodeTestArgs(['tests/e2e/helpers/app-launcher.test.js']), [
|
|
'--experimental-test-module-mocks',
|
|
'--import',
|
|
'tsx',
|
|
'--test',
|
|
'tests/e2e/helpers/app-launcher.test.js',
|
|
])
|
|
})
|