rename paragraph#createRun to paragraph#createTextRun
This commit is contained in:
@ -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;
|
||||||
|
@ -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({
|
||||||
|
Reference in New Issue
Block a user