Skip to main content
Glama
getAllHighlights.test.ts1.31 kB
import axios from 'axios'; import { config } from 'dotenv'; import { describe, expect, it } from 'vitest'; config(); const raindropAccessToken = process.env.RAINDROP_ACCESS_TOKEN; describe('.env configuration', () => { it('should load RAINDROP_ACCESS_TOKEN from environment variables and emit its value', () => { const accessToken = process.env.RAINDROP_ACCESS_TOKEN; // Emit the value for debugging (will show in Vitest output if test fails) expect(accessToken, `RAINDROP_ACCESS_TOKEN value: ${accessToken}`).toBeDefined(); }); }); describe('Raindrop API Integration', () => { it('fetches highlights from the API', async () => { if (!raindropAccessToken) { throw new Error('RAINDROP_ACCESS_TOKEN environment variable is required. Please check your .env file or environment settings.'); } const api = axios.create({ baseURL: 'https://api.raindrop.io/rest/v1', headers: { Authorization: `Bearer ${raindropAccessToken}`, 'Content-Type': 'application/json', }, }); const userHighlightsResponse = await api.get('/highlights'); expect(userHighlightsResponse.status).toBe(200); expect(userHighlightsResponse.data).toHaveProperty('items'); expect(Array.isArray(userHighlightsResponse.data.items)).toBe(true); }); });

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/adeze/raindrop-mcp'

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