Skip to main content
Glama

MCP TypeScript Template

runtime.test.ts1.39 kB
/** * @fileoverview Unit tests for runtime capability detection. * @module tests/utils/internal/runtime.test */ import { describe, expect, it } from 'vitest'; import { runtimeCaps } from '../../../src/utils/internal/runtime.js'; describe('Runtime Capabilities', () => { it('should detect Node.js environment', () => { // This test runs in Node, so should be true expect(runtimeCaps.isNode).toBe(true); expect(runtimeCaps.hasProcess).toBe(true); expect(runtimeCaps.hasBuffer).toBe(true); }); it('should correctly identify not being a worker or browser', () => { expect(runtimeCaps.isWorkerLike).toBe(false); expect(runtimeCaps.isBrowserLike).toBe(false); }); it('should detect TextEncoder availability', () => { expect(runtimeCaps.hasTextEncoder).toBe(true); }); it('should detect performance.now availability', () => { expect(runtimeCaps.hasPerformanceNow).toBe(true); }); it('should export a valid RuntimeCapabilities object', () => { expect(runtimeCaps).toHaveProperty('isNode'); expect(runtimeCaps).toHaveProperty('isWorkerLike'); expect(runtimeCaps).toHaveProperty('isBrowserLike'); expect(runtimeCaps).toHaveProperty('hasProcess'); expect(runtimeCaps).toHaveProperty('hasBuffer'); expect(runtimeCaps).toHaveProperty('hasTextEncoder'); expect(runtimeCaps).toHaveProperty('hasPerformanceNow'); }); });

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/mintedmaterial/mcp-ts-template'

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