Skip to main content
Glama
giri-jeedigunta

Test Analyzer MCP Server

utils.test.js1.64 kB
import { add, subtract, multiply, divide, isEven, capitalize } from '../utils'; describe('Math utilities', () => { describe('add', () => { it('should add two positive numbers', () => { expect(add(2, 3)).toBe(5); }); it('should add negative numbers', () => { expect(add(-2, -3)).toBe(-5); }); }); describe('subtract', () => { it('should subtract two numbers', () => { expect(subtract(5, 3)).toBe(2); }); }); describe('multiply', () => { it('should multiply two numbers', () => { expect(multiply(3, 4)).toBe(12); }); it('should handle multiplication by zero', () => { expect(multiply(5, 0)).toBe(0); }); }); describe('divide', () => { it('should divide two numbers', () => { expect(divide(10, 2)).toBe(5); }); it('should throw error for division by zero', () => { expect(() => divide(10, 0)).toThrow('Division by zero'); }); }); }); describe('Utility functions', () => { describe('isEven', () => { it('should return true for even numbers', () => { expect(isEven(4)).toBe(true); expect(isEven(0)).toBe(true); }); it('should return false for odd numbers', () => { expect(isEven(3)).toBe(false); expect(isEven(-1)).toBe(false); }); }); describe('capitalize', () => { it('should capitalize first letter', () => { expect(capitalize('hello')).toBe('Hello'); }); it('should handle empty string', () => { expect(capitalize('')).toBe(''); }); it('should handle mixed case', () => { expect(capitalize('hELLO')).toBe('Hello'); }); }); });

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/giri-jeedigunta/hello-mcp'

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