1import { describe, expect, it } from 'vitest'2import worker from '../src/index'34describe('catalog service boundary', () => {5 it('does not expose a rendering proxy', async () => {6 const response = await worker.fetch(new Request('https://diagram.zip/render/v1/svg', {7 method: 'POST',8 headers: { 'Content-Type': 'application/json' },9 body: JSON.stringify({ engine: 'graphviz', source: 'digraph { a -> b }', format: 'svg' }),10 }))1112 expect(response.status).toBe(404)13 await expect(response.json()).resolves.toMatchObject({ error: { code: 'not_found' } })14 })1516 it('publishes the complete catalog', async () => {17 const response = await worker.fetch(new Request('https://diagram.zip/render/v1/catalog'))18 expect(response.status).toBe(200)19 await expect(response.json()).resolves.toMatchObject({ format: 'svg', engines: { length: 32 } })20 })21})