Fix and enable linting on tests
This commit is contained in:
@ -1,6 +1,9 @@
|
|||||||
|
// tslint:disable:no-string-literal
|
||||||
|
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import { Formatter } from "../../export/formatter";
|
import { Formatter } from "../../export/formatter";
|
||||||
import { ContentTypes } from "./content-types";
|
import { ContentTypes } from "./content-types";
|
||||||
|
|
||||||
describe("ContentTypes", () => {
|
describe("ContentTypes", () => {
|
||||||
let contentTypes: ContentTypes;
|
let contentTypes: ContentTypes;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
|
|
||||||
import { Formatter } from "../../../../export/formatter";
|
import { Formatter } from "../../../../export/formatter";
|
||||||
|
import { FooterReferenceType, PageBorderOffsetFrom, PageNumberFormat } from "./";
|
||||||
import { SectionProperties } from "./section-properties";
|
import { SectionProperties } from "./section-properties";
|
||||||
import { FooterReferenceType, PageNumberFormat, PageBorderOffsetFrom } from ".";
|
|
||||||
|
|
||||||
describe("SectionProperties", () => {
|
describe("SectionProperties", () => {
|
||||||
describe("#constructor()", () => {
|
describe("#constructor()", () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { assert } from "chai";
|
import { assert } from "chai";
|
||||||
|
|
||||||
import { SimplePos } from "./simple-pos";
|
|
||||||
import { Utility } from "../../../tests/utility";
|
import { Utility } from "../../../tests/utility";
|
||||||
|
import { SimplePos } from "./simple-pos";
|
||||||
|
|
||||||
describe("SimplePos", () => {
|
describe("SimplePos", () => {
|
||||||
describe("#constructor()", () => {
|
describe("#constructor()", () => {
|
||||||
|
@ -22,7 +22,7 @@ describe("External styles factory", () => {
|
|||||||
</w:pPr>
|
</w:pPr>
|
||||||
</w:pPrDefault>
|
</w:pPrDefault>
|
||||||
</w:docDefaults>
|
</w:docDefaults>
|
||||||
|
|
||||||
<w:latentStyles w:defLockedState="1" w:defUIPriority="99">
|
<w:latentStyles w:defLockedState="1" w:defUIPriority="99">
|
||||||
</w:latentStyles>
|
</w:latentStyles>
|
||||||
|
|
||||||
@ -48,6 +48,7 @@ describe("External styles factory", () => {
|
|||||||
|
|
||||||
describe("#parse", () => {
|
describe("#parse", () => {
|
||||||
it("should parse w:styles attributes", () => {
|
it("should parse w:styles attributes", () => {
|
||||||
|
// tslint:disable-next-line:no-any
|
||||||
const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;
|
const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;
|
||||||
|
|
||||||
expect(importedStyle.rootKey).to.equal("w:styles");
|
expect(importedStyle.rootKey).to.equal("w:styles");
|
||||||
@ -58,6 +59,7 @@ describe("External styles factory", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should parse other child elements of w:styles", () => {
|
it("should parse other child elements of w:styles", () => {
|
||||||
|
// tslint:disable-next-line:no-any
|
||||||
const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;
|
const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;
|
||||||
|
|
||||||
expect(importedStyle.root.length).to.equal(5);
|
expect(importedStyle.root.length).to.equal(5);
|
||||||
@ -134,6 +136,7 @@ describe("External styles factory", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should parse styles elements", () => {
|
it("should parse styles elements", () => {
|
||||||
|
// tslint:disable-next-line:no-any
|
||||||
const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;
|
const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;
|
||||||
|
|
||||||
expect(importedStyle.root.length).to.equal(5);
|
expect(importedStyle.root.length).to.equal(5);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
|
|
||||||
import { TableCellBorders, TableCellWidth, WidthType } from "./table-cell";
|
|
||||||
import { Formatter } from "../../export/formatter";
|
import { Formatter } from "../../export/formatter";
|
||||||
import { BorderStyle } from "../styles";
|
import { BorderStyle } from "../styles";
|
||||||
|
import { TableCellBorders, TableCellWidth, WidthType } from "./table-cell";
|
||||||
|
|
||||||
describe("TableCellBorders", () => {
|
describe("TableCellBorders", () => {
|
||||||
describe("#prepForXml", () => {
|
describe("#prepForXml", () => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import { ImportedXmlComponent, convertToXmlComponent } from "./";
|
import { convertToXmlComponent, ImportedXmlComponent } from "./";
|
||||||
|
|
||||||
const xmlString = `
|
const xmlString = `
|
||||||
<w:p w:one="value 1" w:two="value 2">
|
<w:p w:one="value 1" w:two="value 2">
|
||||||
@ -11,10 +11,11 @@ const xmlString = `
|
|||||||
</w:r>
|
</w:r>
|
||||||
<w:r active="true">
|
<w:r active="true">
|
||||||
<w:t>Text 2</w:t>
|
<w:t>Text 2</w:t>
|
||||||
</w:r>
|
</w:r>
|
||||||
</w:p>
|
</w:p>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
// tslint:disable:object-literal-key-quotes
|
||||||
const importedXmlElement = {
|
const importedXmlElement = {
|
||||||
"w:p": {
|
"w:p": {
|
||||||
_attr: { "w:one": "value 1", "w:two": "value 2" },
|
_attr: { "w:one": "value 1", "w:two": "value 2" },
|
||||||
@ -22,6 +23,7 @@ const importedXmlElement = {
|
|||||||
"w:r": [{ _attr: { active: "true" }, "w:t": "Text 1" }, { _attr: { active: "true" }, "w:t": "Text 2" }],
|
"w:r": [{ _attr: { active: "true" }, "w:t": "Text 1" }, { _attr: { active: "true" }, "w:t": "Text 2" }],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
// tslint:enable:object-literal-key-quotes
|
||||||
|
|
||||||
const convertedXmlElement = {
|
const convertedXmlElement = {
|
||||||
deleted: false,
|
deleted: false,
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"tests",
|
"tests",
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/_*"
|
"**/_*"
|
||||||
],
|
],
|
||||||
"typedocOptions": {
|
"typedocOptions": {
|
||||||
|
Reference in New Issue
Block a user