Skip to main content
Glama
config.schema-validator.test.ts1.2 kB
import '../setup/test-setup.js' import test from 'node:test' import assert from 'node:assert/strict' import { SchemaValidator } from '../../src/config/schema-validator.js' test('SchemaValidator accepts minimal valid config', async () => { const schema = await SchemaValidator.loadSchema('config/schema.json') const cfg = { master_oauth: { authorization_endpoint: 'https://auth.local/authorize', token_endpoint: 'https://auth.local/token', client_id: 'x', redirect_uri: 'http://localhost/cb', scopes: ['openid'], }, hosting: { platform: 'node' }, servers: [], } assert.doesNotThrow(() => SchemaValidator.assertValid(cfg, schema!)) }) test('SchemaValidator rejects invalid platform', async () => { const schema = await SchemaValidator.loadSchema('config/schema.json') const cfg: any = { master_oauth: { authorization_endpoint: 'https://auth.local/authorize', token_endpoint: 'https://auth.local/token', client_id: 'x', redirect_uri: 'http://localhost/cb', scopes: ['openid'], }, hosting: { platform: 'nope' }, servers: [], } assert.throws(() => SchemaValidator.assertValid(cfg, schema!)) })

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jakedismo/master-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server