rename paragraph#createRun to paragraph#createTextRun

This commit is contained in:
felipe
2017-03-10 14:44:25 +01:00
parent 8d11ec3422
commit 35ddda444a
2 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ export class Paragraph extends XmlComponent {
return this; return this;
} }
public createRun(text: string): TextRun { public createTextRun(text: string): TextRun {
const run = new TextRun(text); const run = new TextRun(text);
this.addText(run); this.addText(run);
return run; return run;

View File

@ -32,9 +32,9 @@ describe("Paragraph", () => {
}); });
}); });
describe("#createRun", () => { describe("#createTextRun", () => {
it("should add a new run to the paragraph and return it", () => { it("should add a new run to the paragraph and return it", () => {
const run = paragraph.createRun("this is a test run"); const run = paragraph.createTextRun("this is a test run");
expect(run).to.be.instanceof(docx.TextRun); expect(run).to.be.instanceof(docx.TextRun);
const tree = new Formatter().format(paragraph)["w:p"]; const tree = new Formatter().format(paragraph)["w:p"];
expect(tree).to.be.an("array").which.includes({ expect(tree).to.be.an("array").which.includes({