Skip to main content
Glama
geocode.test.ts1.02 kB
import {geocode} from "../../src/gpf/geocode.js"; describe("Test geocode",() => { it("should return the expected value for 'Mairie de Loray'", async () => { const results : any[] = await geocode("Mairie de Loray"); expect(results.length).toBeGreaterThanOrEqual(0); const firstItem = results[0]; // x: 6.497148, expect(firstItem.lon).toBeCloseTo(6.497148,5); // y: 47.153263, expect(firstItem.lat).toBeCloseTo(47.153263,5); // country: 'PositionOfInterest', // names: [ 'Mairie de Loray' ], // city: 'Loray', // zipcode: '25390', // zipcodes: [ '25390' ], // metropole: true, // poiType: [ 'mairie', "zone d'activité ou d'intérêt" ], // street: 'Mairie de Loray', // kind: 'mairie', // fulltext: 'Mairie de Loray, 25390 Loray', expect(firstItem.fulltext).toEqual('Mairie de Loray, 25390 Loray'); // classification: 9 }); });

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/ignfab/geocontext'

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