test: migrate test runner from web-test-runner to vitest#153
Conversation
Replace @web/test-runner with vitest in browser mode (Playwright/Chromium). All 574 tests pass; no test logic changed. - Swap chai's `expect` for vitest's built-in `expect` across all 63 spec files (mechanical import change only). - Add vitest.config.ts: browser mode, v8 coverage, coverage enabled by default. Use `isolate: false` to avoid an iframe-load race in @vitest/browser 4.x that intermittently dropped random test files (single-worker modes deadlock, so they aren't an option). - Ratchet coverage thresholds to current values with autoUpdate; they sit just below 100% only because v8 counts branches more strictly than the istanbul instrumentation web-test-runner used. - Drop web-test-runner deps (@web/*, chai, mocha, concurrently); add vitest, @vitest/browser(-playwright), @vitest/coverage-v8, playwright. - Remove stray tGSE/canAddSampledValueControl.ts (a misplaced duplicate; the real file lives in tSampledValueControl/). - Ignore vitest browser-mode failure artifacts (.vitest-attachments, __screenshots__). - Require Node ^20.19 || >=22.12 via package.json engines, and bump CI from Node 18 to 22. vitest 4's bundler (rolldown) imports `styleText` from node:util, which does not exist before Node 20.19/22.12, so Node 18 fails at startup with "does not provide an export named 'styleText'". - Install the Playwright chromium browser in CI, required to run vitest's browser-mode tests. Closes openscd#152
01a4423 to
b913f51
Compare
|
wow!! that happened fast! |
stee-re
left a comment
There was a problem hiding this comment.
I'm really really hoping we can avoid Browser mode.
|
I'm looking into this. I'm not sure JSDOM has the XML handling capability we need at this time (see e.g. this jsdom/jsdom#1775) |
Replace @web/test-runner with vitest in browser mode (Playwright/Chromium). All 574 tests pass; no test logic changed.
expectfor vitest's built-inexpectacross all 63 spec files (mechanical import change only).isolate: falseto avoid an iframe-load race in @vitest/browser 4.x that intermittently dropped random test files (single-worker modes deadlock, so they aren't an option).Closes #152