Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/docxml/src/utilities/tests.ts>createXmlRoundRobinTest

TypeScript (component) library for building and parsing a DOCX file
Go to Latest
function createXmlRoundRobinTest
import { createXmlRoundRobinTest } from "https://deno.land/x/docxml@5.5.1/src/utilities/tests.ts";

Creates a small test suite to assert that an object can succesfully be parsed from XML, serialized to XML again and then parses a 2nd time to the same object as before.

Succeeding this test means the two functions convert back-and-forth without loss of information.

Type Parameters

ObjectShape extends { [key: string]: unknown; }

Parameters

fromNode: (n: Node | null) => ObjectShape
toNode: (n: ObjectShape) => Node | null