Web Test Runner
Test runner for web applications.
šĀ Ā Headless browsers with Puppeteer, Playwright, or Selenium.
š§Ā Ā Reports logs, 404s, and errors from the browser.
šĀ Ā Debug opens a real browser window with devtools.
š¦Ā Ā Mock es modules using Import Maps.
š§Ā Ā Exposes browser properties like viewport size and dark mode.
ā±Ā Ā Runs tests in parallel and isolation.
šĀ Ā Interactive watch mode.
šĀ Ā Fast development by rerunning only changed tests.
šĀ Ā Powered by esbuild and rollup plugins
See our website for full documentation.
Installation
Install the web test runner:
npm i --save-dev @web/test-runner
Basic commands
Do a single test run:
web-test-runner test/**/*.test.js --node-resolve
wtr test/**/*.test.js --node-resolve
Run in watch mode, reloading on file changes:
web-test-runner test/**/*.test.js --node-resolve --watch
wtr test/**/*.test.js --node-resolve --watch
Run with code coverage profiling (this is slower):
web-test-runner test/**/*.test.js --node-resolve --coverage
wtr test/**/*.test.js --node-resolve --coverage
Transform JS to a compatible syntax based on user agent:
web-test-runner test/**/*.test.js --node-resolve --esbuild-target auto
wtr test/**/*.test.js --node-resolve --esbuild-target auto
Guide
Check out this step by step guide to get started.
Example projects
Check out the example projects for a fully integrated setup.
Documentation
See our website for full documentation.