2016-07-01 22:09:55 +01:00
|
|
|
import * as docx from "../../../docx";
|
2017-03-07 22:15:53 +00:00
|
|
|
import { assert } from "chai";
|
2016-03-29 04:10:33 +01:00
|
|
|
|
2016-04-03 05:24:56 +01:00
|
|
|
describe("Document", () => {
|
2016-05-26 15:08:34 +01:00
|
|
|
let document: docx.Document;
|
2016-03-29 04:10:33 +01:00
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
document = new docx.Document();
|
|
|
|
});
|
|
|
|
|
2016-05-26 15:08:34 +01:00
|
|
|
describe("#constructor()", () => {
|
|
|
|
|
2016-03-29 04:10:33 +01:00
|
|
|
it("should create valid JSON", () => {
|
2016-05-26 15:08:34 +01:00
|
|
|
let stringifiedJson = JSON.stringify(document);
|
|
|
|
let newJson;
|
2016-03-29 04:10:33 +01:00
|
|
|
|
|
|
|
try {
|
|
|
|
newJson = JSON.parse(stringifiedJson);
|
|
|
|
} catch (e) {
|
|
|
|
assert.isTrue(false);
|
|
|
|
}
|
|
|
|
assert.isTrue(true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|