Logo showing a white checkmark on a greenish background hTest

Declarative unit testing,
for everyone

Headless (Playwright)

Headless mode runs your existing JS-first tests inside a real browser engine (Chromium, Firefox, WebKit) while keeping hTest's Node output and reporting. This is useful when tests rely on browser APIs that don't exist in Node, or when you want parity with real rendering/JS engines without changing how results are displayed.

Why use it

Install

Headless runs are opt-in and require Playwright:

npm i -D playwright
npx playwright install chromium

Usage

Run tests in the default headless browser (Chromium):

npx htest --headless path/to/tests

Choose a browser engine:

npx htest --headless --browser firefox path/to/tests

Supported values: chromium, firefox, webkit, chrome, edge.

CI/CD

Use --ci to disable interactive mode:

npx htest --headless --ci path/to/tests

Notes