@unibeautify/beautifier-js-beautify
Version:
JS-Beautify beautifier for Unibeautify
25 lines • 819 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const unibeautify_1 = require("unibeautify");
const src_1 = require("../../src");
test("should successfully beautify JSON text", () => {
const unibeautify = unibeautify_1.newUnibeautify();
unibeautify.loadBeautifier(src_1.default);
const text = `{"one":1,"two":[],"three":[3,"three"]}`;
const beautifierResult = `{\n "one": 1,\n "two": [],\n "three": [3, "three"]\n}`;
return unibeautify
.beautify({
languageName: "JSON",
options: {
JSON: {
indent_style: "space",
indent_size: 2,
},
},
text,
})
.then(results => {
expect(results).toBe(beautifierResult);
});
});
//# sourceMappingURL=JSON.spec.js.map