Skip to main content
Glama
markWatchingAsRead.test.ts1.1 kB
import { markWatchingAsReadTool } from './markWatchingAsRead.js'; import { jest, describe, it, expect } from '@jest/globals'; import type { Backlog } from 'backlog-js'; import { createTranslationHelper } from '../createTranslationHelper.js'; describe('markWatchingAsReadTool', () => { const mockBacklog: Partial<Backlog> = { resetWatchingListItemAsRead: jest .fn<() => Promise<void>>() .mockResolvedValue(undefined), }; const mockTranslationHelper = createTranslationHelper(); const tool = markWatchingAsReadTool( mockBacklog as Backlog, mockTranslationHelper ); it('returns success message as formatted JSON text', async () => { const result = await tool.handler({ watchId: 123, }); if (Array.isArray(result)) { throw new Error('Unexpected array result'); } expect(result.success).toBe(true); }); it('calls backlog.resetWatchingListItemAsRead with correct params', async () => { await tool.handler({ watchId: 123, }); expect(mockBacklog.resetWatchingListItemAsRead).toHaveBeenCalledWith(123); }); });

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/nulab/backlog-mcp-server'

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