openai-plugins
Version:
A TypeScript library that provides an OpenAI-compatible client for the Model Context Protocol (MCP).
30 lines (25 loc) • 1.08 kB
text/typescript
describe('Utils Tests', () => {
// Testing logging functionality
test('Logging utilities are available', () => {
const { setMcpLogLevel, log, MCP_LOG_LVL } = require('../dist/openai-mcp');
expect(setMcpLogLevel).toBeDefined();
expect(log).toBeDefined();
expect(MCP_LOG_LVL).toBeDefined();
});
// Make sure exported items exist
test('Check for exported items', () => {
const openaiMcp = require('../dist/openai-mcp');
// Check that the module exports something
expect(openaiMcp).toBeDefined();
// Check that we have some exported logging utilities
expect(typeof openaiMcp.setMcpLogLevel).toBe('function');
expect(typeof openaiMcp.log).toBe('function');
// Check that we have a default export or OpenAI export
// This is a more flexible test that will pass as long as there's
// something that looks like an OpenAI export
const hasOpenAIExport =
(typeof openaiMcp.default === 'function') ||
(typeof openaiMcp.OpenAI === 'function');
expect(hasOpenAIExport).toBe(true);
});
});