Skip to main content
Glama
emit-reset.test.js741 B
'use strict' const { test } = require('node:test') const { createWarning } = require('../') const { withResolvers } = require('./promise') test('a limited warning can be re-set', t => { t.plan(4) const { promise, resolve } = withResolvers() let count = 0 process.on('warning', onWarning) function onWarning () { count++ } const warn = createWarning({ name: 'TestDeprecation', code: 'CODE', message: 'Hello world' }) warn() t.assert.ok(warn.emitted) warn() t.assert.ok(warn.emitted) warn.emitted = false warn() t.assert.ok(warn.emitted) setImmediate(() => { t.assert.deepStrictEqual(count, 2) process.removeListener('warning', onWarning) resolve() }) return promise })

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