The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.

Viewing files at commit c95a8380814fCommit detailsView latest

tests/api.test.ts 17 lines · 696 B · typescript
1
import { describe, expect, it } from 'vitest';
2
import { buildApi } from '../apps/api/src/app.js';
3
4
describe('HTTP API', () => {
5
  it('serves health, readiness, and OpenAPI', async () => {
6
    const app = buildApi();
7
    await app.ready();
8
    expect((await app.inject({ method: 'GET', url: '/health' })).statusCode).toBe(200);
9
    expect((await app.inject({ method: 'GET', url: '/ready' })).json()).toEqual({
10
      status: 'ready',
11
    });
12
    const specification = (await app.inject({ method: 'GET', url: '/openapi.json' })).json();
13
    expect(specification.info.title).toBe('OpenClasp API');
14
    expect(specification.paths).toHaveProperty('/v0.1/risk/assess');
15
    await app.close();
16
  });
17
});