-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathweb-test-runner.config.js
More file actions
34 lines (33 loc) · 954 Bytes
/
web-test-runner.config.js
File metadata and controls
34 lines (33 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { playwrightLauncher } from '@web/test-runner-playwright';
export default {
files: "tests/web-test-runner/*.test.html",
coverage: true,
nodeResolve: true,
browsers: [
playwrightLauncher({
product: 'firefox', // Use Firefox instead of Chrome (web-test-runner’s default), because Firefox doesn’t have a native implementation of 'ariaNotify' (as of 2025-11-07), so we can test the polyfill in it.
launchOptions: { headless: true }
}),
],
plugins: [
{
name: "include-polyfill",
transform(context) {
if (context.response.is("html")) {
return context.body.replace(
/<\/body>/,
`
<script src="./arianotify-polyfill.js"></script>
<script type="module">
import { runTests } from "@web/test-runner-mocha";
import { tests } from "./arianotify-polyfill.test.js";
runTests(tests);
</script>
</body>
`
);
}
},
},
],
};