UNPKG

@unibeautify/beautifier-prettydiff

Version:
47 lines 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const unibeautify_1 = require("unibeautify"); const src_1 = require("../../src"); test(`should successfully beautify CSS text with new lines between rules`, () => { const unibeautify = unibeautify_1.newUnibeautify(); unibeautify.loadBeautifier(src_1.default); const text = `.className1{font-size:12pt;}.className2{font-weight:bold;}`; const beautifierResult = `.className1 {\n\tfont-size: 12pt;\n}\n\n.className2 {\n\tfont-weight: bold;\n}`; return unibeautify .beautify({ languageName: "CSS", options: { CSS: { newline_between_rules: true, indent_style: "tab", indent_size: 1, }, }, text, }) .then(results => { expect(results).toBe(beautifierResult); }); }); test(`should successfully beautify CSS text without new lines between rules`, () => { const unibeautify = unibeautify_1.newUnibeautify(); unibeautify.loadBeautifier(src_1.default); const text = `.className1{font-size:12pt;}.className2{font-weight:bold;}`; const beautifierResult = `.className1 {\n\tfont-size: 12pt;\n}\n.className2 {\n\tfont-weight: bold;\n}`; return unibeautify .beautify({ languageName: "CSS", options: { CSS: { newline_between_rules: false, indent_style: "tab", indent_size: 1, }, }, text, }) .then(results => { expect(results).toBe(beautifierResult); }); }); //# sourceMappingURL=cssNewLines.spec.js.map