Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/gateway-mcp/src/__tests__/api-smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { initializeDatabase } from '../db/database'
import { PolicyEngine } from '../policies/policy-engine'
import { CheckAPI } from '../api/check'
import { TraceAPI } from '../api/traces'
import { ProfileManager } from '../services/profile-manager'

const logger = pino({ level: 'silent' })

Expand Down Expand Up @@ -120,6 +121,17 @@ describe('gateway API smoke tests', () => {
expect(typeof body.timestamp).toBe('string')
})

test('fresh database initializes the profile manager', async () => {
const profileManager = new ProfileManager(harness.db, logger)

try {
await expect(profileManager.initialize()).resolves.toBeUndefined()
expect(profileManager.size).toBe(0)
} finally {
profileManager.shutdown()
}
})

test('check endpoint allows a benign tool call', async () => {
const { response, body } = await jsonRequest(harness.baseUrl, '/api/v1/check', {
method: 'POST',
Expand Down