@unibeautify/beautifier-prettydiff
Version:
Pretty Diff beautifier for Unibeautify
25 lines • 889 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const unibeautify_1 = require("unibeautify");
const src_1 = require("../../src");
test(`should successfully beautify XML text`, () => {
const unibeautify = unibeautify_1.newUnibeautify();
unibeautify.loadBeautifier(src_1.default);
const text = `<email>\n\t\t\t<to>foo</to><from>bar</from><subject>Hello World!</subject></email>`;
const beautifierResult = `<email>\n\t<to>foo</to>\n\t<from>bar</from>\n\t<subject>Hello World!</subject>\n</email>`;
return unibeautify
.beautify({
languageName: "XML",
options: {
XML: {
indent_style: "tab",
indent_size: 1,
},
},
text,
})
.then(results => {
expect(results).toBe(beautifierResult);
});
});
//# sourceMappingURL=xml.spec.js.map