Skip to main content
Glama
attribute.test.ts1.08 kB
import { defineTests, expect, mockExec } from "file:///app/index.ts"; export default defineTests({ "returns most recent AMI matching filters": { input: { region: "us-east-1", Filters: [ { Name: "name", Value: "ubuntu-*" }, { Name: "architecture", Value: "x86_64" }, ], Owners: "amazon", }, mocks: { exec: mockExec() .command("aws ec2 describe-images") .returns({ stdout: JSON.stringify([ { ImageId: "ami-newest123" }, { ImageId: "ami-older456" }, ]), exitCode: 0, }), }, expect: { validate: (result) => { if (result !== "ami-newest123") { throw new Error(`Expected ami-newest123, got ${result}`); } }, }, }, "returns empty string when no filters specified": { input: { region: "us-east-1", }, expect: { validate: (result) => { if (result !== "") { throw new Error(`Expected empty string, got ${result}`); } }, }, }, });

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/systeminit/si'

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