diff --git a/_all-pages/hljsCoverage.test.ts b/_all-pages/hljsCoverage.test.ts index e050b3b..e68a826 100644 --- a/_all-pages/hljsCoverage.test.ts +++ b/_all-pages/hljsCoverage.test.ts @@ -1,5 +1,5 @@ import { assertArrayIncludes } from "assert"; -import { siteFiles } from "./siteFiles.ts"; +import { siteFiles } from "./testing.ts"; const hljsClassesIn = (path: string): IterableIterator => Deno.readTextFileSync(path).matchAll(/hljs-\w+/g); diff --git a/_all-pages/hljsWorkaround.test.ts b/_all-pages/hljsWorkaround.test.ts index 3d4c7a5..7ef6b66 100644 --- a/_all-pages/hljsWorkaround.test.ts +++ b/_all-pages/hljsWorkaround.test.ts @@ -1,8 +1,8 @@ /* cSpell:words hljs */ import { assertEquals } from "assert"; -import { documentFromHtml, documentToHtml } from "testDom"; import { hljsWorkaround } from "./hljsWorkaround.ts"; +import { documentFromHtml, documentToHtml } from "./testing.ts"; Deno.test("It removes all .hljs-number elements within a .language-dockerfile", () => { const originalHtml = [ diff --git a/_all-pages/siteFiles.ts b/_all-pages/siteFiles.ts deleted file mode 100644 index 0096cfe..0000000 --- a/_all-pages/siteFiles.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { type FileInfo, default as getFiles } from "getFiles"; - -export const siteFiles = (extension: string): Array => - getFiles({ "root": "./_site" }) - .filter((file: FileInfo): boolean => file.ext == extension) - .map((file: FileInfo): string => file.path); diff --git a/_all-pages/stripWhitespace.test.ts b/_all-pages/stripWhitespace.test.ts index 59de86a..1057122 100644 --- a/_all-pages/stripWhitespace.test.ts +++ b/_all-pages/stripWhitespace.test.ts @@ -1,6 +1,6 @@ import { assertEquals } from "assert"; -import { documentFromHtml, documentToHtml } from "testDom"; import { stripWhitespace } from "./stripWhitespace.ts"; +import { documentFromHtml, documentToHtml } from "./testing.ts"; Deno.test("It removes all whitespace", () => { const document = documentFromHtml([ diff --git a/_all-pages/testDom.ts b/_all-pages/testing.ts similarity index 59% rename from _all-pages/testDom.ts rename to _all-pages/testing.ts index 44034c8..3820db3 100644 --- a/_all-pages/testDom.ts +++ b/_all-pages/testing.ts @@ -1,3 +1,4 @@ +import { type FileInfo, default as getFiles } from "getFiles"; import { DOMParser } from "lume/deps/dom.ts"; export const documentFromHtml = (html: string | Array): Document => { @@ -10,3 +11,8 @@ export const documentFromHtml = (html: string | Array): Document => { export const documentToHtml = (document: Document): string => document.documentElement.outerHTML; + +export const siteFiles = (extension: string): Array => + getFiles({ "root": "./_site" }) + .filter((file: FileInfo): boolean => file.ext == extension) + .map((file: FileInfo): string => file.path); diff --git a/_all-pages/validHtml.test.ts b/_all-pages/validHtml.test.ts index 26c6859..caf6c19 100644 --- a/_all-pages/validHtml.test.ts +++ b/_all-pages/validHtml.test.ts @@ -1,6 +1,6 @@ import { assert } from "assert"; import { HtmlValidate, formatterFactory } from "htmlValidate"; -import { siteFiles } from "./siteFiles.ts"; +import { siteFiles } from "./testing.ts"; Deno.test("Output HTML files are valid", async () => { const htmlValidate = new HtmlValidate();