Turn Run into a declaritive API

This commit is contained in:
Dolan
2019-06-17 01:51:57 +01:00
parent a1cd5e9573
commit fb65bb4207
27 changed files with 411 additions and 183 deletions

View File

@ -29,7 +29,12 @@ describe("Formatter", () => {
it("should format simple paragraph with bold text", () => {
const paragraph = new file.Paragraph("");
paragraph.addRun(new file.TextRun("test").bold());
paragraph.addRun(
new file.TextRun({
text: "test",
bold: true,
}),
);
const newJson = formatter.format(paragraph);
assert.isDefined(newJson["w:p"][1]["w:r"][0]["w:rPr"][0]["w:b"]._attr["w:val"]);
});