Freedom251 › JavaScript Testing Frameworks
ESM Unit

What ESM Unit is
ESM Unit is a free, open-source unit testing tool for developers working with native ECMAScript modules in web browsers. It runs tests in real browsers without bundling or transpilation, and each test file receives its own isolated iframe, window, and DOM document. When a test fails, you can rerun it individually using the browser window’s “Isolate” control. The tool includes built-in assertions and can also load assertion libraries that work as browser ECMAScript modules; its README recommends Sinon for stubbing, mocks, and assertions against mocks. Per-file code coverage reports and configurable coverage thresholds help teams track coverage. The `--watch` option reruns tests when files change, while parallel execution is also supported. The README shows test runs in Chrome, Firefox, and Safari; headless mode is supported in Chrome and Firefox. ESM Unit requires Node 18 LTS or later and is installed as an npm development dependency. Test code must work in browsers as native ECMAScript modules. JSX and local relative imports that are not native ES modules need conversion before use. The repository identifies the project as Apache-2.0 licensed and welcomes issues, pull requests, and contributions.
Who it suits
ESM Unit suits developers who want to unit test native ECMAScript modules directly in web browsers without a bundling or transpilation step. It is a fit for projects whose test code can run as native browser modules and that use Node 18 LTS or later.
What it does well
- Runs browser tests without bundling or transpilation
- Isolates each test file in its own iframe and DOM
- Reruns failed tests individually with the Isolate control
- Reports per-file coverage with configurable thresholds
- Supports parallel execution
- Free and Apache-2.0 licensed
What to know first
- Requires Node 18 LTS or later
- JSX and some local relative imports need conversion
- Headless mode is supported only in Chrome and Firefox
- Watch mode cannot run alongside debug mode
Limits
The free, open-source tool requires Node 18 LTS or later and browser-native ECMAScript module test code. JSX and local relative imports that are not native ES modules must be converted; headless mode is limited to Chrome and Firefox.
Getting started
- Install ESM Unit as an npm development dependency
- Use Node 18 LTS or later
- Prepare test code to run as native ECMAScript modules in current browsers
- Run tests in Chrome, Firefox, or Safari
Verdict
Choose ESM Unit if you need browser-based unit tests for native ECMAScript modules, with isolated test files and coverage reporting. Look elsewhere if your test code depends on JSX or local relative imports that are not native ES modules and you cannot convert them.
Questions
How much does ESM Unit cost?
It is free and open source.
What platforms and browsers does it support?
It runs tests in web browsers, with Chrome, Firefox, Safari, and Microsoft Edge listed as supported runtimes. Headless mode is supported only in Chrome and Firefox.
What does ESM Unit require?
It requires Node 18 LTS or later and test code that runs in current browsers as native ECMAScript modules without transpilation.
Is ESM Unit open source?
Yes. The repository identifies it as Apache-2.0 licensed.
Can it report code coverage?
Yes. It provides per-file coverage reports and configurable coverage thresholds.
Does it integrate with Sinon?
The README recommends Sinon for stubbing, mocking, and assertions against mocks.
Facts from ESM Unit's own pages
- Assertions and mocks
- It includes built-in assertions, supports other assertion libraries loadable as browser ECMAScript modules, and recommends Sinon for stubs and mocks. · github.com, 8 Oct 2026
- Browser execution
- It runs tests in real browsers without bundling or transpilation. · github.com, 8 Oct 2026
- Browser support
- The README shows running tests in Chrome, Firefox, and Safari; headless mode is supported only in Chrome and Firefox. · github.com, 8 Oct 2026
- Coverage
- It supports per-file code coverage reports and configurable coverage thresholds. · github.com, 8 Oct 2026
- Debugging
- A failed test can be rerun on its own by clicking “Isolate” in the browser window. · github.com, 8 Oct 2026
- Distribution
- The README instructs users to install ESM Unit with npm as a development dependency. · github.com, 8 Oct 2026
- Founded
- 1983 · github.com, 28 Sept 2026
- Headquarters
- Mountain View, California, United States · github.com, 28 Sept 2026
- Integrations
- The README recommends Sinon for stubbing, mocking, and assertions against mocks. · github.com, 8 Oct 2026
- Intended users
- The stated use case is developers who need to unit test native ECMAScript modules in web browsers. · github.com, 8 Oct 2026
- License
- The repository license identifies the software as Apache License 2.0 and states that it is provided without warranties or conditions. · github.com, 8 Oct 2026
- Maker
- Intuit’s GitHub organization lists Mountain View, CA as its location. · github.com, 8 Oct 2026
- No build step
- It runs tests in browsers without bundling or transpilation. · github.com, 8 Oct 2026
- Notable limitation
- Code using JSX or imports that are not native ES modules from local relative paths must be converted before running. · github.com, 8 Oct 2026
- Purpose
- ESM Unit is a unit testing tool for native ECMAScript modules in web browsers. · github.com, 8 Oct 2026
- Requirements
- ESM Unit requires Node 18 LTS or later and test code that runs in current browsers as native ECMAScript modules without transpilation. · github.com, 8 Oct 2026
- Support
- The project README invites users to open an issue or pull request and says it welcomes contributions. · github.com, 8 Oct 2026
- Test isolation
- Each test file runs in an isolated iframe with its own window and DOM document. · github.com, 8 Oct 2026
- Watch mode
- The --watch option reruns tests when files change, and cannot be used at the same time as --debug. · github.com, 8 Oct 2026
Where ESM Unit stands on Freedom251
- JavaScript Testing Frameworks#21 of 23