For details setting up each testing framework, see the official examples:
Puppeteer and Playwright are the only E2E test runners that support Chrome Extensions. There are no other options at the time of writing.
There are other options for unit tests however, like Jest, Mocha, or
node:test. WXT does not claim to support any of them because none of them support all of WXT's features, like TypeScript or auto-imports.
If you want to try to use a different framework for unit tests, you will need to configure the environment manually:
- Auto-imports: Add
unimportto your test environment or disable them by setting
imports: falsein your
browsermock: Mock the
webextension-polyfillmodule globally with
- Remote Code Bundling: If you use it, configure your environment to handle the
- Global Variables: If you consume them, manually define globals provided by WXT (like
import.meta.env.BROWSER) by adding them to the global scope before accessing them (
import.meta.env.BROWSER = "chrome")
- Import paths: If you use the
~/path aliases, add them to your test environment
Here's how Vitest is configured for reference.