Fix tests and use proper types for disregarding XMLComponent
This commit is contained in:
@ -8,9 +8,7 @@ describe("PageBorders", () => {
|
||||
describe("#constructor()", () => {
|
||||
it("should create empty element when no options are passed", () => {
|
||||
const properties = new PageBorders();
|
||||
const tree = new Formatter().format(properties);
|
||||
|
||||
expect(tree).to.equal("");
|
||||
expect(() => new Formatter().format(properties)).to.throw();
|
||||
});
|
||||
|
||||
it("should create page borders with some configuration", () => {
|
||||
|
@ -98,7 +98,9 @@ export class PageBorders extends XmlComponent {
|
||||
}
|
||||
}
|
||||
|
||||
public prepForXml(): IXmlableObject {
|
||||
return this.root.length > 0 ? super.prepForXml() : "";
|
||||
public prepForXml(): IXmlableObject | undefined {
|
||||
if (this.root.length > 0) {
|
||||
return super.prepForXml();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user