UNPKG

systemprompt-mcp-notion

Version:

A specialized Model Context Protocol (MCP) server that integrates Notion into your AI workflows. This server enables seamless access to Notion through MCP, allowing AI agents to interact with pages, databases, and comments.

49 lines (48 loc) 1.34 kB
/** * Creates a mock response object for testing */ export function createMockResponse(data, options = {}) { const { ok = true, status = 200, statusText = "OK", headers = {} } = options; return { ok, status, statusText, headers: new Headers(headers), json: () => Promise.resolve(data), text: () => Promise.resolve(typeof data === "string" ? data : JSON.stringify(data)), blob: () => Promise.resolve(new Blob()), }; } /** * Test fixture generator for common test data */ export class TestFixtures { static createNote(overrides = {}) { return { id: "test-note-1", title: "Test Note", content: "Test content", created: new Date().toISOString(), ...overrides, }; } static createNoteList(count) { return Array.from({ length: count }, (_, i) => this.createNote({ id: `test-note-${i + 1}` })); } } /** * Helper to wait for promises to resolve */ export const flushPromises = () => new Promise((resolve) => setImmediate(resolve)); /** * Type guard for error objects */ export function isError(error) { return error instanceof Error; } /** * Creates a partial mock object with type safety */ export function createPartialMock(overrides = {}) { return overrides; }