Skip to main content
Glama
validate-plugin.test.js803 B
'use strict' const { test } = require('tap') const { validatePlugin } = require('../../lib/validate-plugin') const { AVV_ERR_PLUGIN_NOT_VALID } = require('../../lib/errors') test('validatePlugin', (t) => { t.plan(8) t.throws(() => validatePlugin(1), new AVV_ERR_PLUGIN_NOT_VALID('number')) t.throws(() => validatePlugin('function'), new AVV_ERR_PLUGIN_NOT_VALID('string')) t.throws(() => validatePlugin({}), new AVV_ERR_PLUGIN_NOT_VALID('object')) t.throws(() => validatePlugin([]), new AVV_ERR_PLUGIN_NOT_VALID('array')) t.throws(() => validatePlugin(null), new AVV_ERR_PLUGIN_NOT_VALID('null')) t.doesNotThrow(() => validatePlugin(function () {})) t.doesNotThrow(() => validatePlugin(new Promise((resolve) => resolve))) t.doesNotThrow(() => validatePlugin(Promise.resolve())) })

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