-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.mjs
42 lines (39 loc) · 969 Bytes
/
test.mjs
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
35
36
37
38
39
40
41
42
/*
* This file uses "@jsenv/core" to execute all test files.
* See https://github.com/jsenv/jsenv-core/blob/master/docs/testing/readme.md#jsenv-test-runner
*/
import {
executeTestPlan,
chromium,
firefox,
reportCoverageAsJson,
} from "@jsenv/test"
const testPlanResult = await executeTestPlan({
rootDirectoryUrl: new URL("../", import.meta.url),
testPlan: {
"./src/**/*.test.html": {
chromium: {
runtime: chromium(),
},
firefox: {
runtime: firefox(),
},
},
},
webServer: {
origin: "https://localhost:3472",
rootDirectoryUrl: new URL("../src/", import.meta.url),
moduleUrl: new URL("./dev.mjs", import.meta.url),
},
coverage: process.argv.includes("--coverage")
? {
methodForBrowsers: "istanbul",
}
: null,
})
if (process.argv.includes("--coverage")) {
reportCoverageAsJson(
testPlanResult,
new URL("../.coverage/coverage.json", import.meta.url),
)
}