fix: manager races, shutdown order, tool bounds

This commit is contained in:
smartass
2026-06-12 00:21:51 +05:00
parent 6bf2aa74ca
commit ae34ad1bc9
5 changed files with 115 additions and 30 deletions
+14
View File
@@ -73,6 +73,20 @@ describe('connection tools', () => {
])
})
it('add_connection rejects unknown fields', async () => {
const response = await callTool(client, 'add_connection', {
name: 'typo',
type: 'postgres',
host: 'h',
user: 'u',
readOnly: true
})
expect(response.isError).toBe(true)
const list = await callTool(client, 'list_connections')
const names = (list.json() as Array<{ name: string }>).map((c) => c.name)
expect(names).not.toContain('typo')
})
it('add_connection rejects duplicates with isError', async () => {
const response = await callTool(client, 'add_connection', {
name: 'existing',