mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-15 01:24:03 +01:00
17 lines
502 B
TypeScript
17 lines
502 B
TypeScript
import { expect, describe, it } from 'vitest';
|
|
import { validateXml } from './service';
|
|
|
|
describe('xml-validator', () => {
|
|
it('returns Valid XML for well-formed XML', () => {
|
|
const input = '<root><a>1</a><b>2</b></root>';
|
|
const result = validateXml(input, {});
|
|
expect(result).toBe('Valid XML');
|
|
});
|
|
|
|
it('returns error for invalid XML', () => {
|
|
const input = '<root><a>1</b></root>';
|
|
const result = validateXml(input, {});
|
|
expect(result).toMatch(/Invalid XML/i);
|
|
});
|
|
});
|