music21j tests run in a real browser using QUnit + Playwright, orchestrated via Vite. This allows tests to render SVG output and exercise audio-related APIs.
Headless Execution
To run the full test suite headlessly, use npm test. This starts a Vite development server and runs QUnit tests in headless Chromium.
Note: The first time you run tests, you must install the headless Chromium browser:
npx playwright install chromium
Running with an active Vite server
If you already have the Vite development server running, you can run tests using:
npm run test:qunit
You can also view tests and their output by navigating to http://localhost:5173/tests/ in your browser.
# Install headless browser (required once)
npx playwright install chromium
# Run full test suite headlessly
$ npm test
# Run tests if Vite server is already running
$ npm run test:qunit