Files
docx-js/ts/tests/documentTest.ts

27 lines
682 B
TypeScript
Raw Normal View History

2016-03-29 04:10:33 +01:00
/// <reference path="../typings/mocha/mocha.d.ts" />
/// <reference path="../typings/chai/chai.d.ts" />
import * as docx from "../docx";
import {assert} from "chai";
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);
});
});
});