Ran
|
Jobs
2
|
Files
3
|
Run time
2s
|
Badge
README BADGES
|
push
github
Use Vitest v1.0.0-beta.4, run browser tests in CI Per commit af2084baf, running headless browser tests at this moment requires at least Vitest v1.0.0-beta.3. Updating to the beta version seems fine to me so far. I found a way to run the headless browser tests in CI without making a mess of the package.json script by using alternative config files. Updated vite.config.js to use defineConfig() to make type information available in IntelliJ. Added the buildDir() function to vite.config.js to help configure test.outputFile in vitest.config.ci-browser.js. --- I played around with trying to collect coverage from running the tests in the browser. I'll try to add it in a future commit, but the basic issues are: - @vitest/coverage-istanbul is required, because @vitest/coverage-v8 doesn't work in the browser. - The command to run coverage is then: pnpm test -- --browser --coverage.enabled --coverage.provider=istanbul - It currently reports 0% coverage, because when the tests call window.open() (via PageLoader.load()), the modules are loaded in a separate process. I confirmed this last point using a temporary test that imported the main.js module directly after creating a <div id="app"> on window.document, generating 100% coverage. Running the test using Node.js and JSDOM doesn't have the same problem, because JSDOM doesn't open a new process. I've ideas on how to handle this and generate coverage from the browser-run tests in an elegant way that I'll try soon. I'm not sure that I'll absolutely enable this in CI, but we'll see after I try out these ideas and think about it some more.
2 of 2 branches covered (100.0%)
Branch coverage included in aggregate %.
12 of 12 relevant lines covered (100.0%)
2.17 hits per line
ID | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|
1 | 6896293411.1 | 1 |
100.0 |
GitHub Action Run | |
2 | 6896293411.2 | 2 |
100.0 |
GitHub Action Run |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|