Move tests to respective folders as .spec

This is to keep to standards
This commit is contained in:
Dolan
2017-09-17 00:00:41 +01:00
parent 5ae02c3342
commit 72e89cfc3c
32 changed files with 103 additions and 72 deletions

View File

@ -1,11 +1,12 @@
import { assert } from "chai"; import { assert } from "chai";
import { Body } from "../../../docx/document/body";
import { Columns } from "../../../docx/document/body/columns"; import { Utility } from "../../../tests/utility";
import { DocumentGrid } from "../../../docx/document/body/doc-grid"; import { Body } from "./";
import { PageMargin } from "../../../docx/document/body/page-margin"; import { Columns } from "./columns";
import { PageSize } from "../../../docx/document/body/page-size"; import { DocumentGrid } from "./doc-grid";
import { SectionProperties } from "../../../docx/document/body/section-properties"; import { PageMargin } from "./page-margin";
import { Utility } from "../../utility"; import { PageSize } from "./page-size";
import { SectionProperties } from "./section-properties";
describe("Body", () => { describe("Body", () => {
let body: Body; let body: Body;

View File

@ -1,6 +1,7 @@
import { assert, expect } from "chai"; 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", () => { describe("Document", () => {
let document: docx.Document; let document: docx.Document;

View File

@ -1,6 +1,7 @@
import { assert } from "chai"; 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", () => { describe("Border", () => {
// TODO: Need tests here // TODO: Need tests here

View File

@ -1,6 +1,7 @@
import { assert } from "chai"; 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", () => { describe("PageBreak", () => {
let pageBreak: PageBreak; let pageBreak: PageBreak;

View File

@ -1,7 +1,8 @@
import { assert, expect } from "chai"; import { assert, expect } from "chai";
import * as docx from "../../../docx";
import { Formatter } from "../../../export/formatter"; import * as docx from "../../docx";
import { Numbering } from "../../../numbering"; import { Formatter } from "../../export/formatter";
import { Numbering } from "../../numbering";
describe("Paragraph", () => { describe("Paragraph", () => {
let paragraph: docx.Paragraph; let paragraph: docx.Paragraph;
@ -145,7 +146,7 @@ describe("Paragraph", () => {
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({
"w:p": [{ "w:p": [{
"w:pPr": [], "w:pPr": [],
},{ }, {
"w:r": [ "w:r": [
{"w:rPr": []}, {"w:rPr": []},
{"w:br": [{_attr: {"w:type": "page"}}]}, {"w:br": [{_attr: {"w:type": "page"}}]},

View File

@ -1,6 +1,7 @@
import { expect } from "chai"; 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("Spacing", () => {
describe("#constructor", () => { describe("#constructor", () => {

View File

@ -1,6 +1,7 @@
import { assert } from "chai"; 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", () => { describe("ParagraphStyle", () => {
let style: Style; let style: Style;

View File

@ -1,6 +1,7 @@
import { assert } from "chai"; 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", () => { describe("LeftTabStop", () => {
let tabStop: LeftTabStop; let tabStop: LeftTabStop;

View File

@ -1,6 +1,7 @@
import { assert } from "chai"; 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", () => { describe("NumberProperties", () => {
let numberProperties: NumberProperties; let numberProperties: NumberProperties;

View File

@ -1,6 +1,7 @@
import { assert } from "chai"; 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", () => { describe("Break", () => {
let currentBreak: Break; let currentBreak: Break;

View File

@ -1,7 +1,8 @@
import { assert } from "chai"; import { assert } from "chai";
import * as fs from "fs"; 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", () => { describe("Drawing", () => {
let currentBreak: Drawing; let currentBreak: Drawing;

View File

@ -1,6 +1,7 @@
import { expect } from "chai"; 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("Text", () => {
describe("#constructor", () => { describe("#constructor", () => {

View File

@ -1,6 +1,7 @@
import { expect } from "chai"; 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", () => { describe("RunFonts", () => {

View File

@ -1,7 +1,8 @@
import { assert, expect } from "chai"; import { assert, expect } from "chai";
import { Run } from "../../../docx/run";
import { Formatter } from "../../../export/formatter"; import { Formatter } from "../../export/formatter";
import { Utility } from "../../utility"; import { Utility } from "../../tests/utility";
import { Run } from "./";
describe("Run", () => { describe("Run", () => {
let run: Run; let run: Run;

View File

@ -1,6 +1,7 @@
import { assert } from "chai"; 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", () => { describe("SubScript", () => {
let subScript: SubScript; let subScript: SubScript;

View File

@ -1,6 +1,7 @@
import { assert } from "chai"; 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", () => { describe("Strike", () => {
let strike: Strike; let strike: Strike;

View File

@ -1,6 +1,7 @@
import { assert } from "chai"; 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", () => { describe("Tab", () => {
let tab: Tab; let tab: Tab;

View File

@ -1,6 +1,7 @@
import { expect } from "chai"; 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", () => { describe("TextRun", () => {
let run: TextRun; let run: TextRun;

View File

@ -1,7 +1,8 @@
import { assert, expect } from "chai"; import { assert, expect } from "chai";
import * as u from "../../../docx/run/underline";
import { Formatter } from "../../../export/formatter"; import { Formatter } from "../../export/formatter";
import { Utility } from "../../utility"; import { Utility } from "../../tests/utility";
import * as u from "./underline";
describe("Underline", () => { describe("Underline", () => {

View File

@ -1,6 +1,7 @@
import { expect } from "chai"; 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("GridCol", () => {
describe("#constructor", () => { describe("#constructor", () => {

View File

@ -1,6 +1,7 @@
import { expect } from "chai"; 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("TableProperties", () => {
describe("#constructor", () => { describe("#constructor", () => {

View File

@ -1,8 +1,9 @@
/* tslint:disable:no-unused-expression */ /* tslint:disable:no-unused-expression */
import { expect } from "chai"; 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("Table", () => {
describe("#constructor", () => { describe("#constructor", () => {

View File

@ -1,5 +1,6 @@
import { assert } from "chai"; import { assert } from "chai";
import { Attributes } from "../../../docx/xml-components";
import { Attributes } from "./";
describe("Attribute", () => { describe("Attribute", () => {
describe("#constructor()", () => { describe("#constructor()", () => {

View File

@ -1,6 +1,7 @@
import { assert } from "chai"; 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 { class TestComponent extends XmlComponent {

View File

@ -1,10 +1,10 @@
import { assert } from "chai"; import { assert } from "chai";
import * as docx from "../../docx"; import * as docx from "../docx";
import { Attributes } from "../../docx/xml-components"; import { Attributes } from "../docx/xml-components";
import { Formatter } from "../../export/formatter"; import { Formatter } from "../export/formatter";
import { Properties } from "../../properties"; import { Properties } from "../properties";
import { Utility } from "../utility"; import { Utility } from "../tests/utility";
describe("Formatter", () => { describe("Formatter", () => {
let formatter: Formatter; let formatter: Formatter;

View File

@ -1,9 +1,9 @@
import { expect } from "chai"; import { expect } from "chai";
import { Formatter } from "../export/formatter"; import { Formatter } from "../export/formatter";
import { Numbering } from "../numbering"; import { Numbering } from "./";
import { AbstractNumbering } from "../numbering/abstract-numbering"; import { AbstractNumbering } from "./abstract-numbering";
import { LevelForOverride } from "../numbering/level"; import { LevelForOverride } from "./level";
import { Num } from "../numbering/num"; import { Num } from "./num";
describe("Numbering", () => { describe("Numbering", () => {

View File

@ -1,7 +1,7 @@
import { expect } from "chai"; import { expect } from "chai";
import { Formatter } from "../export/formatter"; import { Formatter } from "../export/formatter";
import { Properties } from "../properties"; import { Properties } from "./";
describe("Properties", () => { describe("Properties", () => {

View File

@ -1,8 +1,8 @@
import { assert, expect } from "chai"; import { assert, expect } from "chai";
import { Formatter } from "../export/formatter"; import { Formatter } from "../export/formatter";
import { Styles } from "../styles"; import { Styles } from "./";
import { ParagraphStyle, Style } from "../styles/style"; import { ParagraphStyle, Style } from "./style";
import * as components from "../styles/style/components"; import * as components from "./style/components";
describe("Styles", () => { describe("Styles", () => {
let styles: Styles; let styles: Styles;

View File

@ -9,5 +9,9 @@
"sourceRoot": "./", "sourceRoot": "./",
"rootDir": "./", "rootDir": "./",
"module": "commonjs" "module": "commonjs"
} },
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
} }

View File

@ -1,5 +1,6 @@
/* tslint:disable */ /* tslint:disable */
import { assert } from "chai"; import { assert } from "chai";
import { Utility } from "./utility"; import { Utility } from "./utility";
/* tslint:enable */ /* tslint:enable */

View File

@ -12,6 +12,8 @@
"declaration": true "declaration": true
}, },
"exclude": [ "exclude": [
"tests" "tests",
"**/*.spec.ts",
"**/_*"
] ]
} }