Skip to main content
Glama
orneryd

M.I.M.I.R - Multi-agent Intelligent Memory & Insight Repository

by orneryd
worker-1-output.md1.11 kB
# Task Output: worker-1 ```typescript import { describe, it, expect } from 'vitest'; import { calculateTotal } from './calculateTotal'; describe('calculateTotal', () => { it('should return the correct total for valid inputs', () => { const items = [ { price: 10, quantity: 2 }, { price: 5, quantity: 4 }, ]; const result = calculateTotal(items); expect(result).toBe(40); }); it('should return 0 for an empty array', () => { const items: Array<{ price: number; quantity: number }> = []; const result = calculateTotal(items); expect(result).toBe(0); }); it('should return 0 if items is null or undefined', () => { const result1 = calculateTotal(null as any); const result2 = calculateTotal(undefined as any); expect(result1).toBe(0); expect(result2).toBe(0); }); it('should handle items with zero price or quantity', () => { const items = [ { price: 0, quantity: 5 }, { price: 10, quantity: 0 }, { price: 15, quantity: 2 }, ]; const result = calculateTotal(items); expect(result).toBe(30); }); }); ```

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/orneryd/Mimir'

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