diff --git a/ts/tests/docx/document/bodyTest.ts b/ts/docx/document/body/body.spec.ts similarity index 74% rename from ts/tests/docx/document/bodyTest.ts rename to ts/docx/document/body/body.spec.ts index bbb8dcf42e..01a867044b 100644 --- a/ts/tests/docx/document/bodyTest.ts +++ b/ts/docx/document/body/body.spec.ts @@ -1,11 +1,12 @@ import { assert } from "chai"; -import { Body } from "../../../docx/document/body"; -import { Columns } from "../../../docx/document/body/columns"; -import { DocumentGrid } from "../../../docx/document/body/doc-grid"; -import { PageMargin } from "../../../docx/document/body/page-margin"; -import { PageSize } from "../../../docx/document/body/page-size"; -import { SectionProperties } from "../../../docx/document/body/section-properties"; -import { Utility } from "../../utility"; + +import { Utility } from "../../../tests/utility"; +import { Body } from "./"; +import { Columns } from "./columns"; +import { DocumentGrid } from "./doc-grid"; +import { PageMargin } from "./page-margin"; +import { PageSize } from "./page-size"; +import { SectionProperties } from "./section-properties"; describe("Body", () => { let body: Body; diff --git a/ts/tests/docx/document/documentTest.ts b/ts/docx/document/document.spec.ts similarity index 96% rename from ts/tests/docx/document/documentTest.ts rename to ts/docx/document/document.spec.ts index dd311a85ea..172812e93a 100644 --- a/ts/tests/docx/document/documentTest.ts +++ b/ts/docx/document/document.spec.ts @@ -1,6 +1,7 @@ import { assert, expect } from "chai"; -import * as docx from "../../../docx"; -import { Formatter } from "../../../export/formatter"; + +import * as docx from "../../"; +import { Formatter } from "../../export/formatter"; describe("Document", () => { let document: docx.Document; diff --git a/ts/tests/docx/paragraph/borderTest.ts b/ts/docx/paragraph/border.spec.ts similarity index 87% rename from ts/tests/docx/paragraph/borderTest.ts rename to ts/docx/paragraph/border.spec.ts index e7af104bd3..105f6732a2 100644 --- a/ts/tests/docx/paragraph/borderTest.ts +++ b/ts/docx/paragraph/border.spec.ts @@ -1,6 +1,7 @@ import { assert } from "chai"; -import { ThematicBreak } from "../../../docx/paragraph/border"; -import { Utility } from "../../utility"; + +import { Utility } from "../../tests/utility"; +import { ThematicBreak } from "./border"; describe("Border", () => { // TODO: Need tests here diff --git a/ts/tests/docx/paragraph/pageBreakTests.ts b/ts/docx/paragraph/page-break.spec.ts similarity index 89% rename from ts/tests/docx/paragraph/pageBreakTests.ts rename to ts/docx/paragraph/page-break.spec.ts index 28c2b15257..e7b6a2f32c 100644 --- a/ts/tests/docx/paragraph/pageBreakTests.ts +++ b/ts/docx/paragraph/page-break.spec.ts @@ -1,6 +1,7 @@ import { assert } from "chai"; -import { PageBreak } from "../../../docx/paragraph/page-break"; -import { Utility } from "../../utility"; + +import { Utility } from "../../tests/utility"; +import { PageBreak } from "./page-break"; describe("PageBreak", () => { let pageBreak: PageBreak; diff --git a/ts/tests/docx/paragraph/paragraphTests.ts b/ts/docx/paragraph/paragraph.spec.ts similarity index 98% rename from ts/tests/docx/paragraph/paragraphTests.ts rename to ts/docx/paragraph/paragraph.spec.ts index 4c17c4d056..7b88e077d7 100644 --- a/ts/tests/docx/paragraph/paragraphTests.ts +++ b/ts/docx/paragraph/paragraph.spec.ts @@ -1,7 +1,8 @@ import { assert, expect } from "chai"; -import * as docx from "../../../docx"; -import { Formatter } from "../../../export/formatter"; -import { Numbering } from "../../../numbering"; + +import * as docx from "../../docx"; +import { Formatter } from "../../export/formatter"; +import { Numbering } from "../../numbering"; describe("Paragraph", () => { let paragraph: docx.Paragraph; @@ -145,7 +146,7 @@ describe("Paragraph", () => { expect(tree).to.deep.equal({ "w:p": [{ "w:pPr": [], - },{ + }, { "w:r": [ {"w:rPr": []}, {"w:br": [{_attr: {"w:type": "page"}}]}, diff --git a/ts/tests/docx/paragraph/spacingTest.ts b/ts/docx/paragraph/spacing.spec.ts similarity index 86% rename from ts/tests/docx/paragraph/spacingTest.ts rename to ts/docx/paragraph/spacing.spec.ts index f5b458e2bd..b940adeff7 100644 --- a/ts/tests/docx/paragraph/spacingTest.ts +++ b/ts/docx/paragraph/spacing.spec.ts @@ -1,6 +1,7 @@ import { expect } from "chai"; -import { Spacing } from "../../../docx/paragraph/spacing"; -import { Formatter } from "../../../export/formatter"; + +import { Formatter } from "../../export/formatter"; +import { Spacing } from "./spacing"; describe("Spacing", () => { describe("#constructor", () => { diff --git a/ts/tests/docx/paragraph/paragraphStyleTest.ts b/ts/docx/paragraph/style.spec.ts similarity index 85% rename from ts/tests/docx/paragraph/paragraphStyleTest.ts rename to ts/docx/paragraph/style.spec.ts index 1b9ceae4a6..3ee3050828 100644 --- a/ts/tests/docx/paragraph/paragraphStyleTest.ts +++ b/ts/docx/paragraph/style.spec.ts @@ -1,6 +1,7 @@ import { assert } from "chai"; -import { Style } from "../../../docx/paragraph/style"; -import { Utility } from "../../utility"; + +import { Utility } from "../../tests/utility"; +import { Style } from "./style"; describe("ParagraphStyle", () => { let style: Style; diff --git a/ts/tests/docx/paragraph/tabStopTests.ts b/ts/docx/paragraph/tab-stop.spec.ts similarity index 92% rename from ts/tests/docx/paragraph/tabStopTests.ts rename to ts/docx/paragraph/tab-stop.spec.ts index 13ffb3c307..892a1f1490 100644 --- a/ts/tests/docx/paragraph/tabStopTests.ts +++ b/ts/docx/paragraph/tab-stop.spec.ts @@ -1,6 +1,7 @@ import { assert } from "chai"; -import { LeftTabStop, MaxRightTabStop } from "../../../docx/paragraph/tab-stop"; -import { Utility } from "../../utility"; + +import { Utility } from "../../tests/utility"; +import { LeftTabStop, MaxRightTabStop } from "./tab-stop"; describe("LeftTabStop", () => { let tabStop: LeftTabStop; diff --git a/ts/tests/docx/paragraph/unorderedListTests.ts b/ts/docx/paragraph/unordered-list.spec.ts similarity index 89% rename from ts/tests/docx/paragraph/unorderedListTests.ts rename to ts/docx/paragraph/unordered-list.spec.ts index c6c5080791..31d26bafbd 100644 --- a/ts/tests/docx/paragraph/unorderedListTests.ts +++ b/ts/docx/paragraph/unordered-list.spec.ts @@ -1,6 +1,7 @@ import { assert } from "chai"; -import { NumberProperties } from "../../../docx/paragraph/unordered-list"; -import { Utility } from "../../utility"; + +import { Utility } from "../../tests/utility"; +import { NumberProperties } from "./unordered-list"; describe("NumberProperties", () => { let numberProperties: NumberProperties; diff --git a/ts/tests/docx/run/breakTests.ts b/ts/docx/run/break.spec.ts similarity index 81% rename from ts/tests/docx/run/breakTests.ts rename to ts/docx/run/break.spec.ts index 86904765ea..f34f60bfbc 100644 --- a/ts/tests/docx/run/breakTests.ts +++ b/ts/docx/run/break.spec.ts @@ -1,6 +1,7 @@ import { assert } from "chai"; -import { Break } from "../../../docx/run/break"; -import { Utility } from "../../utility"; + +import { Utility } from "../../tests/utility"; +import { Break } from "./break"; describe("Break", () => { let currentBreak: Break; diff --git a/ts/tests/docx/run/run-components/drawingTests.ts b/ts/docx/run/run-components/drawing/drawing.spec.ts similarity index 85% rename from ts/tests/docx/run/run-components/drawingTests.ts rename to ts/docx/run/run-components/drawing/drawing.spec.ts index 46b2904aab..aa55535059 100644 --- a/ts/tests/docx/run/run-components/drawingTests.ts +++ b/ts/docx/run/run-components/drawing/drawing.spec.ts @@ -1,7 +1,8 @@ import { assert } from "chai"; import * as fs from "fs"; -import { Drawing } from "../../../../docx/run/run-components/drawing"; -import { Utility } from "../../../utility"; + +import { Utility } from "../../../../tests/utility"; +import { Drawing } from "./"; describe("Drawing", () => { let currentBreak: Drawing; diff --git a/ts/tests/docx/run/run-components/text.ts b/ts/docx/run/run-components/text.spec.ts similarity index 84% rename from ts/tests/docx/run/run-components/text.ts rename to ts/docx/run/run-components/text.spec.ts index 2b536a3f1f..046951ff93 100644 --- a/ts/tests/docx/run/run-components/text.ts +++ b/ts/docx/run/run-components/text.spec.ts @@ -1,6 +1,7 @@ import { expect } from "chai"; -import { Text } from "../../../../docx/run/run-components/text"; -import { Formatter } from "../../../../export/formatter"; + +import { Formatter } from "../../../export/formatter"; +import { Text } from "./text"; describe("Text", () => { describe("#constructor", () => { diff --git a/ts/tests/docx/run/fontTests.ts b/ts/docx/run/run-fonts.spec.ts similarity index 86% rename from ts/tests/docx/run/fontTests.ts rename to ts/docx/run/run-fonts.spec.ts index a136a6949a..cf419a4e18 100644 --- a/ts/tests/docx/run/fontTests.ts +++ b/ts/docx/run/run-fonts.spec.ts @@ -1,6 +1,7 @@ import { expect } from "chai"; -import { RunFonts } from "../../../docx/run/run-fonts"; -import { Formatter } from "../../../export/formatter"; + +import { Formatter } from "../../export/formatter"; +import { RunFonts } from "./run-fonts"; describe("RunFonts", () => { diff --git a/ts/tests/docx/run/runTest.ts b/ts/docx/run/run.spec.ts similarity index 97% rename from ts/tests/docx/run/runTest.ts rename to ts/docx/run/run.spec.ts index f8f7826def..32b277592e 100644 --- a/ts/tests/docx/run/runTest.ts +++ b/ts/docx/run/run.spec.ts @@ -1,7 +1,8 @@ import { assert, expect } from "chai"; -import { Run } from "../../../docx/run"; -import { Formatter } from "../../../export/formatter"; -import { Utility } from "../../utility"; + +import { Formatter } from "../../export/formatter"; +import { Utility } from "../../tests/utility"; +import { Run } from "./"; describe("Run", () => { let run: Run; diff --git a/ts/tests/docx/run/scriptTests.ts b/ts/docx/run/script.spec.ts similarity index 93% rename from ts/tests/docx/run/scriptTests.ts rename to ts/docx/run/script.spec.ts index 94d3d25c00..5f8cdb3aeb 100644 --- a/ts/tests/docx/run/scriptTests.ts +++ b/ts/docx/run/script.spec.ts @@ -1,6 +1,7 @@ import { assert } from "chai"; -import { SubScript, SuperScript } from "../../../docx/run/script"; -import { Utility } from "../../utility"; + +import { Utility } from "../../tests/utility"; +import { SubScript, SuperScript } from "./script"; describe("SubScript", () => { let subScript: SubScript; diff --git a/ts/tests/docx/run/strikeTests.ts b/ts/docx/run/strike.spec.ts similarity index 87% rename from ts/tests/docx/run/strikeTests.ts rename to ts/docx/run/strike.spec.ts index 44dcece140..4b07b308b9 100644 --- a/ts/tests/docx/run/strikeTests.ts +++ b/ts/docx/run/strike.spec.ts @@ -1,6 +1,7 @@ import { assert } from "chai"; -import { DoubleStrike, Strike } from "../../../docx/run/formatting"; -import { Utility } from "../../utility"; + +import { Utility } from "../../tests/utility"; +import { DoubleStrike, Strike } from "./formatting"; describe("Strike", () => { let strike: Strike; diff --git a/ts/tests/docx/run/tabTests.ts b/ts/docx/run/tab.spec.ts similarity index 80% rename from ts/tests/docx/run/tabTests.ts rename to ts/docx/run/tab.spec.ts index 5a006943dd..b709eb88be 100644 --- a/ts/tests/docx/run/tabTests.ts +++ b/ts/docx/run/tab.spec.ts @@ -1,6 +1,7 @@ import { assert } from "chai"; -import { Tab } from "../../../docx/run/tab"; -import { Utility } from "../../utility"; + +import { Utility } from "../../tests/utility"; +import { Tab } from "./tab"; describe("Tab", () => { let tab: Tab; diff --git a/ts/tests/docx/run/textRunTests.ts b/ts/docx/run/text-run.spec.ts similarity index 80% rename from ts/tests/docx/run/textRunTests.ts rename to ts/docx/run/text-run.spec.ts index 7aacf69507..9f52e9a402 100644 --- a/ts/tests/docx/run/textRunTests.ts +++ b/ts/docx/run/text-run.spec.ts @@ -1,6 +1,7 @@ import { expect } from "chai"; -import { TextRun } from "../../../docx/run/text-run"; -import { Formatter } from "../../../export/formatter"; + +import { Formatter } from "../../export/formatter"; +import { TextRun } from "./text-run"; describe("TextRun", () => { let run: TextRun; diff --git a/ts/tests/docx/run/underlineTests.ts b/ts/docx/run/underline.spec.ts similarity index 97% rename from ts/tests/docx/run/underlineTests.ts rename to ts/docx/run/underline.spec.ts index 079baf3337..70c70d8cad 100644 --- a/ts/tests/docx/run/underlineTests.ts +++ b/ts/docx/run/underline.spec.ts @@ -1,7 +1,8 @@ import { assert, expect } from "chai"; -import * as u from "../../../docx/run/underline"; -import { Formatter } from "../../../export/formatter"; -import { Utility } from "../../utility"; + +import { Formatter } from "../../export/formatter"; +import { Utility } from "../../tests/utility"; +import * as u from "./underline"; describe("Underline", () => { diff --git a/ts/tests/docx/table/testGrid.ts b/ts/docx/table/grid.spec.ts similarity index 90% rename from ts/tests/docx/table/testGrid.ts rename to ts/docx/table/grid.spec.ts index 5eb234fd29..b032ec16db 100644 --- a/ts/tests/docx/table/testGrid.ts +++ b/ts/docx/table/grid.spec.ts @@ -1,6 +1,7 @@ import { expect } from "chai"; -import { GridCol, TableGrid } from "../../../docx/table/grid"; -import { Formatter } from "../../../export/formatter"; + +import { Formatter } from "../../export/formatter"; +import { GridCol, TableGrid } from "./grid"; describe("GridCol", () => { describe("#constructor", () => { diff --git a/ts/tests/docx/table/testProperties.ts b/ts/docx/table/properties.spec.ts similarity index 90% rename from ts/tests/docx/table/testProperties.ts rename to ts/docx/table/properties.spec.ts index 427419cbd8..d095a636a3 100644 --- a/ts/tests/docx/table/testProperties.ts +++ b/ts/docx/table/properties.spec.ts @@ -1,6 +1,7 @@ import { expect } from "chai"; -import { TableProperties } from "../../../docx/table/properties"; -import { Formatter } from "../../../export/formatter"; + +import { Formatter } from "../../export/formatter"; +import { TableProperties } from "./properties"; describe("TableProperties", () => { describe("#constructor", () => { diff --git a/ts/tests/docx/table/testTable.ts b/ts/docx/table/table.spec.ts similarity index 98% rename from ts/tests/docx/table/testTable.ts rename to ts/docx/table/table.spec.ts index 8035422360..8d4302249f 100644 --- a/ts/tests/docx/table/testTable.ts +++ b/ts/docx/table/table.spec.ts @@ -1,8 +1,9 @@ /* tslint:disable:no-unused-expression */ import { expect } from "chai"; -import { Paragraph } from "../../../docx/paragraph"; -import { Table } from "../../../docx/table"; -import { Formatter } from "../../../export/formatter"; + +import { Formatter } from "../../export/formatter"; +import { Paragraph } from "../paragraph"; +import { Table } from "./"; describe("Table", () => { describe("#constructor", () => { diff --git a/ts/tests/docx/xml-components/attributeTest.ts b/ts/docx/xml-components/attribute.spec.ts similarity index 93% rename from ts/tests/docx/xml-components/attributeTest.ts rename to ts/docx/xml-components/attribute.spec.ts index 928164e051..723ea7df0d 100644 --- a/ts/tests/docx/xml-components/attributeTest.ts +++ b/ts/docx/xml-components/attribute.spec.ts @@ -1,5 +1,6 @@ import { assert } from "chai"; -import { Attributes } from "../../../docx/xml-components"; + +import { Attributes } from "./"; describe("Attribute", () => { describe("#constructor()", () => { diff --git a/ts/tests/docx/xml-components/xmlComponentTests.ts b/ts/docx/xml-components/xml-component.spec.ts similarity index 82% rename from ts/tests/docx/xml-components/xmlComponentTests.ts rename to ts/docx/xml-components/xml-component.spec.ts index 65d635342f..9bcaa7470a 100644 --- a/ts/tests/docx/xml-components/xmlComponentTests.ts +++ b/ts/docx/xml-components/xml-component.spec.ts @@ -1,6 +1,7 @@ import { assert } from "chai"; -import { XmlComponent } from "../../../docx/xml-components"; -import { Utility } from "../../utility"; + +import { Utility } from "../../tests/utility"; +import { XmlComponent } from "./"; class TestComponent extends XmlComponent { diff --git a/ts/tests/export/formatterTest.ts b/ts/export/formatter.spec.ts similarity index 91% rename from ts/tests/export/formatterTest.ts rename to ts/export/formatter.spec.ts index 959a51392c..5bab6ab24b 100644 --- a/ts/tests/export/formatterTest.ts +++ b/ts/export/formatter.spec.ts @@ -1,10 +1,10 @@ import { assert } from "chai"; -import * as docx from "../../docx"; -import { Attributes } from "../../docx/xml-components"; -import { Formatter } from "../../export/formatter"; -import { Properties } from "../../properties"; -import { Utility } from "../utility"; +import * as docx from "../docx"; +import { Attributes } from "../docx/xml-components"; +import { Formatter } from "../export/formatter"; +import { Properties } from "../properties"; +import { Utility } from "../tests/utility"; describe("Formatter", () => { let formatter: Formatter; diff --git a/ts/tests/export/localPackerTest.ts b/ts/export/packer/local.spec.ts similarity index 100% rename from ts/tests/export/localPackerTest.ts rename to ts/export/packer/local.spec.ts diff --git a/ts/tests/numberingTest.ts b/ts/numbering/numbering.spec.ts similarity index 98% rename from ts/tests/numberingTest.ts rename to ts/numbering/numbering.spec.ts index 81f24068d2..6758268022 100644 --- a/ts/tests/numberingTest.ts +++ b/ts/numbering/numbering.spec.ts @@ -1,9 +1,9 @@ import { expect } from "chai"; import { Formatter } from "../export/formatter"; -import { Numbering } from "../numbering"; -import { AbstractNumbering } from "../numbering/abstract-numbering"; -import { LevelForOverride } from "../numbering/level"; -import { Num } from "../numbering/num"; +import { Numbering } from "./"; +import { AbstractNumbering } from "./abstract-numbering"; +import { LevelForOverride } from "./level"; +import { Num } from "./num"; describe("Numbering", () => { diff --git a/ts/tests/propertiesTest.ts b/ts/properties/properties.spec.ts similarity index 98% rename from ts/tests/propertiesTest.ts rename to ts/properties/properties.spec.ts index c11505381d..f28c0ae72f 100644 --- a/ts/tests/propertiesTest.ts +++ b/ts/properties/properties.spec.ts @@ -1,7 +1,7 @@ import { expect } from "chai"; import { Formatter } from "../export/formatter"; -import { Properties } from "../properties"; +import { Properties } from "./"; describe("Properties", () => { diff --git a/ts/tests/stylesTest.ts b/ts/styles/styles.spec.ts similarity index 99% rename from ts/tests/stylesTest.ts rename to ts/styles/styles.spec.ts index 8709d752fa..82a3df72bb 100644 --- a/ts/tests/stylesTest.ts +++ b/ts/styles/styles.spec.ts @@ -1,8 +1,8 @@ import { assert, expect } from "chai"; import { Formatter } from "../export/formatter"; -import { Styles } from "../styles"; -import { ParagraphStyle, Style } from "../styles/style"; -import * as components from "../styles/style/components"; +import { Styles } from "./"; +import { ParagraphStyle, Style } from "./style"; +import * as components from "./style/components"; describe("Styles", () => { let styles: Styles; diff --git a/ts/test-tsconfig.json b/ts/test-tsconfig.json index 255c0e089c..a8a86483fb 100644 --- a/ts/test-tsconfig.json +++ b/ts/test-tsconfig.json @@ -9,5 +9,9 @@ "sourceRoot": "./", "rootDir": "./", "module": "commonjs" - } + }, + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] } diff --git a/ts/tests/_testTemplate.ts b/ts/tests/_testTemplate.ts index 54ba0b0ee8..9cc4b088d7 100644 --- a/ts/tests/_testTemplate.ts +++ b/ts/tests/_testTemplate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ import { assert } from "chai"; + import { Utility } from "./utility"; /* tslint:enable */ diff --git a/ts/tsconfig.json b/ts/tsconfig.json index bdb1db6489..dcfbf57ac0 100644 --- a/ts/tsconfig.json +++ b/ts/tsconfig.json @@ -12,6 +12,8 @@ "declaration": true }, "exclude": [ - "tests" + "tests", + "**/*.spec.ts", + "**/_*" ] }