Unit tests This tool enables running unit & integration tests in the browser. This allows testing code in the target platform with access to browser context and APIs without the need to mock those out with JSDOM. This uses a lightweight testing tool called modern web, Mocha, and Chai for testing framework and assertion libraries. Chai should be imported as an ESM module like this import { expect } from '@esm-bundle/chai'; This is almost as fast as Node.js alternatives like Mocha, but this relies on spinning a headless browser, cold startups do take a second, but warm startups are much shorter with all tests running under 2 seconds. ## Getting started Install and run shell npm i npm run test ### Debugging in browser Running a browser UI requires setting up browser runners. shell # setup playwright & puppeteer npx playwright install npx puppeteer browsers install chrome # run test npm run test:watch