Skip to main content
Glama
context.test.js760 B
'use strict' const { test } = require('node:test') const { kRouteContext } = require('../../lib/symbols') const Context = require('../../lib/context') const Fastify = require('../..') test('context', async context => { context.plan(1) await context.test('Should not contain undefined as key prop', async t => { t.plan(4) const app = Fastify() app.get('/', (req, reply) => { t.assert.ok(req[kRouteContext] instanceof Context) t.assert.ok(reply[kRouteContext] instanceof Context) t.assert.ok(!('undefined' in reply[kRouteContext])) t.assert.ok(!('undefined' in req[kRouteContext])) reply.send('hello world!') }) try { await app.inject('/') } catch (e) { t.assert.fail(e) } }) })

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/krtw00/search-mcp'

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