Skip to content
Snippets Groups Projects
Commit 432fb34e authored by Benjamin Franzke's avatar Benjamin Franzke
Browse files

[TASK] Migrate JavaScript unit test from karma to @web/test-runner

Use @web/test-runner which is toolset by the modern-web.dev and
open-wc.org initiatives. It is based on mocha and es-dev-server,
which allows to run our JavaScript modules natively in the browser
(without having to bundle them via rollup).

Note that compiled test files have been removed from the
source tree, since we configure es-dev-server to transpile
them on demand, allowing error output from tests to be
using original line numbers and unmangled identifiers.

The tests are executed in chrome by default (locally and CI).
They can be executed via:

  # Run once
  npm run test

  # Run tests whenever files change
  npm run watch:build
  npm run watch:test

  # Open browser with devtools and debug mode activated
  MODE=dev npm run watch:test -- --debug

Configuration is prepared to run in multiple browsers via playwright.
Example:

  # https://playwright.dev/docs/browsers#install-system-dependencies
  npx playwright install --with-deps
  B...
parent 6447ae74
Branches
Tags
No related merge requests found
Showing
with 178 additions and 424 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment