Skip to main content
Glama
xml.test.ts765 B
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { convertToCompactXml, parseXml } from './xml'; describe('convertToCompactXml', () => { test('empty string', () => { expect(convertToCompactXml('')).toEqual(''); }); test('string', () => { expect(convertToCompactXml('Hello World')).toEqual('Hello World'); }); test('should preserve attributes', () => { const original = '<myElement id="123">John Doe</myElement>'; const parsed = parseXml(original); expect(parsed).toMatchObject({ myElement: { '#text': 'John Doe', '@_id': '123', }, }); const xml = convertToCompactXml(parsed); expect(xml).toEqual(original); }); });

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/medplum/medplum'

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