diff --git a/ts/tests/docx/run/underlineTests.ts b/ts/tests/docx/run/underlineTests.ts index 4a6e931598..fa40923306 100644 --- a/ts/tests/docx/run/underlineTests.ts +++ b/ts/tests/docx/run/underlineTests.ts @@ -1,9 +1,10 @@ -import * as u from "../../../docx/run/underline"; -import { TextRun } from "../../../docx/run/text-run"; import { assert } from "chai"; -function jsonify(obj: Object) { - let stringifiedJson = JSON.stringify(obj); +import { TextRun } from "../../../docx/run/text-run"; +import * as u from "../../../docx/run/underline"; + +function jsonify(obj: object) { + const stringifiedJson = JSON.stringify(obj); return JSON.parse(stringifiedJson); } @@ -12,8 +13,8 @@ describe("Underline", () => { describe("#constructor()", () => { it("should create a new Underline object with u:u as the rootKey", () => { - let underline = new u.Underline(); - let newJson = jsonify(underline); + const underline = new u.Underline(); + const newJson = jsonify(underline); assert.equal(newJson.rootKey, "w:u"); }); }); @@ -23,14 +24,14 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should have u:u as the rootKey", () => { - let underline = new u.DashDotDotHeavyUnderline(); - let newJson = jsonify(underline); + const underline = new u.DashDotDotHeavyUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.rootKey, "w:u"); }); it("should put value in attribute", () => { - let underline = new u.DashDotDotHeavyUnderline(); - let newJson = jsonify(underline); + const underline = new u.DashDotDotHeavyUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "dashDotDotHeavy"); }); }); @@ -40,8 +41,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.DashDotHeavyUnderline(); - let newJson = jsonify(underline); + const underline = new u.DashDotHeavyUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "dashDotHeavy"); }); }); @@ -51,8 +52,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.DashLongHeavyUnderline(); - let newJson = jsonify(underline); + const underline = new u.DashLongHeavyUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "dashLongHeavy"); }); }); @@ -62,8 +63,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.DashLongUnderline(); - let newJson = jsonify(underline); + const underline = new u.DashLongUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "dashLong"); }); }); @@ -73,8 +74,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.DashUnderline(); - let newJson = jsonify(underline); + const underline = new u.DashUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "dash"); }); }); @@ -84,8 +85,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.DotDashUnderline(); - let newJson = jsonify(underline); + const underline = new u.DotDashUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "dotDash"); }); }); @@ -95,8 +96,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.DotDotDashUnderline(); - let newJson = jsonify(underline); + const underline = new u.DotDotDashUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "dotDotDash"); }); }); @@ -106,8 +107,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.DottedHeavyUnderline(); - let newJson = jsonify(underline); + const underline = new u.DottedHeavyUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "dottedHeavy"); }); }); @@ -117,8 +118,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.DottedUnderline(); - let newJson = jsonify(underline); + const underline = new u.DottedUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "dotted"); }); }); @@ -128,8 +129,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.DoubleUnderline(); - let newJson = jsonify(underline); + const underline = new u.DoubleUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "double"); }); }); @@ -139,8 +140,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.SingleUnderline(); - let newJson = jsonify(underline); + const underline = new u.SingleUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "single"); }); }); @@ -150,8 +151,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.ThickUnderline(); - let newJson = jsonify(underline); + const underline = new u.ThickUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "thick"); }); }); @@ -161,8 +162,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.WaveUnderline(); - let newJson = jsonify(underline); + const underline = new u.WaveUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "wave"); }); }); @@ -172,8 +173,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.WavyDoubleUnderline(); - let newJson = jsonify(underline); + const underline = new u.WavyDoubleUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "wavyDouble"); }); }); @@ -183,8 +184,8 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.WavyHeavyUnderline(); - let newJson = jsonify(underline); + const underline = new u.WavyHeavyUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "wavyHeavy"); }); }); @@ -194,9 +195,9 @@ describe("DashDotDotHeavyUnderline", () => { describe("#constructor()", () => { it("should put value in attribute", () => { - let underline = new u.WordsUnderline(); - let newJson = jsonify(underline); + const underline = new u.WordsUnderline(); + const newJson = jsonify(underline); assert.equal(newJson.root[0].root.val, "words"); }); }); -}); \ No newline at end of file +});