Skip to main content
Glama
SemanticScholarSearcher.test.ts1.62 kB
/** * SemanticScholarSearcher Platform Tests */ import { describe, it, expect, beforeEach } from '@jest/globals'; import { SemanticScholarSearcher } from '../../src/platforms/SemanticScholarSearcher.js'; describe('SemanticScholarSearcher', () => { let searcher: SemanticScholarSearcher; beforeEach(() => { searcher = new SemanticScholarSearcher(); }); describe('getCapabilities', () => { it('should return correct capabilities', () => { const caps = searcher.getCapabilities(); expect(caps.search).toBe(true); expect(caps.download).toBe(true); expect(caps.citations).toBe(true); expect(caps.requiresApiKey).toBe(false); // Optional }); }); describe('constructor', () => { it('should work without API key', () => { const instance = new SemanticScholarSearcher(); expect(instance).toBeDefined(); }); it('should accept API key for higher rate limits', () => { const instance = new SemanticScholarSearcher('test-key'); expect(instance).toBeDefined(); }); }); describe('search options', () => { it('should support fieldsOfStudy filter', () => { expect(searcher.search).toBeDefined(); }); it('should support year filter', () => { expect(searcher.search).toBeDefined(); }); }); describe('getPaperByDoi', () => { it('should use DOI: prefix', () => { expect(searcher.getPaperByDoi).toBeDefined(); }); }); describe('paper details', () => { it('should have getPaperDetails method', () => { expect((searcher as any).getPaperDetails).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