diff --git a/test/missingTableTags.js b/test/missingTableTags.js index 7dfa1e1..3b1d8e0 100644 --- a/test/missingTableTags.js +++ b/test/missingTableTags.js @@ -1,5 +1,6 @@ const jsdom = require("jsdom"); const { JSDOM } = jsdom; +require("iconv-lite").encodingExists("foo"); const tableSortJs = require("../public/table-sort"); function createTestTableNoMissingTags(testTableData, classTags = "") { @@ -30,7 +31,7 @@ function createTestTableNoMissingTags(testTableData, classTags = "") { `); // Call tablesort and make table sortable and simulate click from a user. - tableSortJs(true, tableWithHeadAndBody.window.document); + tableSortJs((testing = true), tableWithHeadAndBody.window.document); tableWithHeadAndBody.window.document.querySelector("table th").click(); // Make an array from table contents to test if sorted correctly. let table = tableWithHeadAndBody.window.document.querySelector("table"); @@ -68,7 +69,7 @@ function createTestTableMissingHeadTag(testTableData, classTags = "") { `); // Call tablesort and make table sortable and simulate click from a user. - tableSortJs(true, tableWithMissingHeadTag.window.document); + tableSortJs((testing = true), tableWithMissingHeadTag.window.document); tableWithMissingHeadTag.window.document.querySelector("table th").click(); // Make an array from table contents to test if sorted correctly. let table = tableWithMissingHeadTag.window.document.querySelector("table"); @@ -106,7 +107,7 @@ function createTestTableMissingBodyTag(testTableData, classTags = "") { `); // Call tablesort and make table sortable and simulate click from a user. - tableSortJs(tablewithMissingBodyTag.window.document); + tableSortJs((testing = true), tablewithMissingBodyTag.window.document); tablewithMissingBodyTag.window.document.querySelector("table th").click(); // Make an array from table contents to test if sorted correctly. let table = tablewithMissingBodyTag.window.document.querySelector("table"); @@ -142,7 +143,7 @@ function createTestTableMissingBodyAndHeadTag(testTableData, classTags = "") { `); // Call tablesort and make table sortable and simulate click from a user. - tableSortJs(true, tableWithMissingBodyAndHeadTag.window.document); + tableSortJs((testing = true), tableWithMissingBodyAndHeadTag.window.document); tableWithMissingBodyAndHeadTag.window.document .querySelector("table th") .click(); @@ -205,7 +206,7 @@ function createTestTableMultipleTBodies( `); // Call tablesort and make table sortable and simulate click from a user. - tableSortJs(true, tableWithMultipleTableBodies.window.document); + tableSortJs((testing = true), tableWithMultipleTableBodies.window.document); const tableTH = tableWithMultipleTableBodies.window.document.querySelectorAll("table th"); for (let th of tableTH) {