Skip to main content
Glama
WileySearcher.test.ts1.64 kB
/** * WileySearcher Platform Tests */ import { describe, it, expect, beforeEach } from '@jest/globals'; import { WileySearcher } from '../../src/platforms/WileySearcher.js'; describe('WileySearcher', () => { let searcher: WileySearcher; beforeEach(() => { searcher = new WileySearcher('test-token'); }); describe('getCapabilities', () => { it('should return correct capabilities', () => { const caps = searcher.getCapabilities(); expect(caps.search).toBe(false); // Search not supported expect(caps.download).toBe(true); expect(caps.fullText).toBe(true); expect(caps.requiresApiKey).toBe(true); }); }); describe('constructor', () => { it('should require TDM token', () => { const noKeySearcher = new WileySearcher(); expect(noKeySearcher).toBeDefined(); }); }); describe('search', () => { it('should throw error as not supported', async () => { await expect(searcher.search('test')).rejects.toThrow(); }); }); describe('downloadPdf', () => { it('should require TDM token', async () => { const noKeySearcher = new WileySearcher(); await expect(noKeySearcher.downloadPdf('10.1002/test')).rejects.toThrow(); }); it('should use DOI for download', () => { expect(searcher.downloadPdf).toBeDefined(); }); it('should encode DOI in URL', () => { // DOI needs encodeURIComponent expect(searcher.downloadPdf).toBeDefined(); }); }); describe('DOI handling', () => { it('should handle DOI with special characters', () => { expect(searcher).toBeDefined(); }); }); });

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/Dianel555/paper-search-mcp-nodejs'

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