Skip to main content
Glama
wfs.test.ts2.28 kB
import { FeatureTypeNotFoundError, wfsClient } from "../../src/gpf/wfs"; describe("Test WfsClient",() => { describe("getFeatureTypes",() => { it("should return the list of feature types with BDTOPO_V3:batiment", async () => { const featureTypes = await wfsClient.getFeatureTypes(); expect(featureTypes).toBeDefined(); expect(featureTypes.length).toBeGreaterThan(0); const featureTypeNames= featureTypes.map((featureType)=>featureType.name); expect(featureTypeNames).toContain("BDTOPO_V3:batiment"); }); }); describe("searchFeatureTypes",() => { it("should find BDTOPO_V3:batiment for 'bâtiments bdtopo'", async () => { const featureTypes = await wfsClient.searchFeatureTypes("bâtiments bdtopo"); expect(featureTypes).toBeDefined(); expect(featureTypes.length).toBeGreaterThan(0); const featureTypeNames= featureTypes.map((featureType)=>featureType.name); expect(featureTypeNames).toContain("BDTOPO_V3:batiment"); }); it("should find BDTOPO_V3:departement and ADMINEXPRESS-COG.LATEST:departement for 'départements'", async () => { const featureTypes = await wfsClient.searchFeatureTypes("départements"); expect(featureTypes).toBeDefined(); expect(featureTypes.length).toBeGreaterThan(0); const featureTypeNames= featureTypes.map((featureType)=>featureType.name); expect(featureTypeNames).toContain("BDTOPO_V3:departement"); expect(featureTypeNames).toContain("ADMINEXPRESS-COG.LATEST:departement"); }); }); describe("getFeatureType",() => { it("should return the feature type with BDTOPO_V3:batiment", async () => { const featureType = await wfsClient.getFeatureType("BDTOPO_V3:batiment"); expect(featureType).toBeDefined(); expect(featureType?.name).toEqual("BDTOPO_V3:batiment"); }); it("should throw an error if the feature type does not exist", async () => { await expect(wfsClient.getFeatureType("BDTOPO_V3:not_found")).rejects.toThrow(FeatureTypeNotFoundError); }); }); });

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