-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(kayle): add split wasm kayle runner
- Loading branch information
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import assert from "assert"; | ||
import puppeteer from "puppeteer"; | ||
import { Standard, kayle } from "kayle"; | ||
import { drakeMock } from "./mocks/html-mock"; | ||
import { performance } from "perf_hooks"; | ||
|
||
(async () => { | ||
const browser = await puppeteer.launch({ headless: "new" }); | ||
const page = await browser.newPage(); | ||
if (process.env.LOG_ENABLED) { | ||
page.on("console", (msg) => console.log("PAGE LOG:", msg.text())); | ||
} | ||
const startTime = performance.now(); | ||
const { issues, pageUrl, documentTitle, meta, automateable } = await kayle({ | ||
page, | ||
browser, | ||
runners: ["kayle"], | ||
includeWarnings: true, | ||
html: drakeMock, | ||
standard: Standard.WCAG2AA, | ||
origin: "https://www.drake.com", | ||
}); | ||
const nextTime = performance.now() - startTime; | ||
|
||
console.log(`Issue count ${issues.length}`); | ||
console.log(meta); | ||
console.log(automateable); | ||
console.log("time took", nextTime); | ||
|
||
// valid list | ||
assert(Array.isArray(issues)); | ||
assert(typeof pageUrl === "string"); | ||
assert(typeof documentTitle === "string"); | ||
assert(meta.errorCount <= 4); | ||
|
||
await browser.close(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters