Skip to main content
Glama
init.test.js1.09 kB
'use strict' const { test } = require('node:test') const proxyquire = require('proxyquire') test('diagnostics_channel when present and subscribers', t => { t.plan(3) let fastifyInHook const diagnostics = { channel (name) { t.assert.strictEqual(name, 'fastify.initialization') return { hasSubscribers: true, publish (event) { t.assert.ok(event.fastify) fastifyInHook = event.fastify } } }, '@noCallThru': true } const fastify = proxyquire('../../fastify', { 'node:diagnostics_channel': diagnostics })() t.assert.strictEqual(fastifyInHook, fastify) }) test('diagnostics_channel when present and no subscribers', t => { t.plan(1) const diagnostics = { channel (name) { t.assert.strictEqual(name, 'fastify.initialization') return { hasSubscribers: false, publish () { t.assert.fail('publish should not be called') } } }, '@noCallThru': true } proxyquire('../../fastify', { 'node:diagnostics_channel': diagnostics })() })

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