added replacements and properties removal in formatter
This commit is contained in:
@ -2,6 +2,12 @@
|
||||
/// <reference path="../typings/lodash/lodash.d.ts" />
|
||||
|
||||
import {Formatter} from "../export/Formatter";
|
||||
import * as docx from "../docx";
|
||||
|
||||
function jsonify(obj: Object) {
|
||||
var stringifiedJson = JSON.stringify(obj);
|
||||
return JSON.parse(stringifiedJson);
|
||||
}
|
||||
|
||||
describe.only('Formatter', () => {
|
||||
var formatter: Formatter;
|
||||
@ -11,8 +17,11 @@ describe.only('Formatter', () => {
|
||||
});
|
||||
|
||||
describe('#format()', () => {
|
||||
it("should work", () => {
|
||||
var newJson = formatter.format({ "p": [{ "t": "test" }] });
|
||||
it("should format simple paragraph", () => {
|
||||
var paragraph = new docx.Paragraph();
|
||||
var newJson = formatter.format(paragraph);
|
||||
newJson = jsonify(newJson);
|
||||
console.log(newJson);
|
||||
});
|
||||
|
||||
it("should should change 'p' tag into 'w:p' tag", () => {
|
||||
|
Reference in New Issue
Block a user