feat: add XML to JSON operation

This commit is contained in:
jpledref 2023-09-23 11:11:25 +02:00
parent 6ed9d4554a
commit 6347f01a47
5 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,24 @@
/**
* XML to JSON tests.
*
* @author jpledref [jp.ledref@gmail.com]
* @copyright Crown Copyright 2023
* @license Apache-2.0
*/
import TestRegister from "../../lib/TestRegister.mjs";
const EXPECTED_JSON = { "root": {"shelf": ["over"], "wood": ["do"], "natural": ["sale"]}};
TestRegister.addTests([
{
name: "XML to JSON",
input: "<root>\n<shelf>over</shelf>\n<wood>do</wood>\n<natural>sale</natural>\n</root>",
expectedOutput: EXPECTED_JSON,
recipeConfig: [
{
op: "XML to JSON",
args: []
},
],
}
]);