listing stuff

This commit is contained in:
Dolan
2017-03-09 22:31:55 +00:00
parent 0e8d92f8bb
commit 5fac776dca
9 changed files with 57 additions and 78 deletions

View File

@ -1,10 +1,6 @@
import { Style } from "../../../docx/paragraph/style";
import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
return JSON.parse(stringifiedJson);
}
import { Style } from "../../../docx/paragraph/style";
import { Utility } from "../../utility";
describe("ParagraphStyle", () => {
let style: Style;
@ -12,15 +8,14 @@ describe("ParagraphStyle", () => {
describe("#constructor()", () => {
it("should create a style with given value", () => {
style = new Style("test");
let newJson = jsonify(style);
const newJson = Utility.jsonify(style);
assert.equal(newJson.root[0].root.val, "test");
});
it("should create a style with blank val", () => {
style = new Style("");
let newJson = jsonify(style);
const newJson = Utility.jsonify(style);
assert.equal(newJson.root[0].root.val, "");
});
});
});
});