UNPKG

@unibeautify/beautifier-prettydiff

Version:
47 lines 1.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const unibeautify_1 = require("unibeautify"); const src_1 = require("../../src"); test(`should successfully beautify HTML text by not force indenting`, () => { const unibeautify = unibeautify_1.newUnibeautify(); unibeautify.loadBeautifier(src_1.default); const text = `<div><p>Some text here, some text there</p></div>`; const beautifierResult = `<div>\n\t<p>Some text here, some text there</p>\n</div>`; return unibeautify .beautify({ languageName: "HTML", options: { HTML: { indent_style: "tab", indent_size: 1, force_indentation: false, }, }, text, }) .then(results => { expect(results).toBe(beautifierResult); }); }); test(`should successfully beautify HTML text by force indenting`, () => { const unibeautify = unibeautify_1.newUnibeautify(); unibeautify.loadBeautifier(src_1.default); const text = `<div><p>Some text here, some text there</p></div>`; const beautifierResult = `<div>\n\t<p>\n\t\tSome text here, some text there</p>\n</div>`; return unibeautify .beautify({ languageName: "HTML", options: { HTML: { indent_style: "tab", indent_size: 1, force_indentation: true, }, }, text, }) .then(results => { expect(results).toBe(beautifierResult); }); }); //# sourceMappingURL=forceIndent.spec.js.map