Mocha wrapper with built-in TypeScript support via esbuild, integrated Jest-compatible expect, mock, and snapshot testing. Current stable version is v5.0.0, released in 2025. Release cadence is irregular with major versions marking breaking changes. Key differentiators include zero-config TypeScript execution, Jest-compatible API for familiar testing patterns, and automatic ESM support for Node >=18.
npm install esmochaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs esmocha, creates a simple TypeScript module and test, then runs the test using esmocha.
Use --loader @node-loaders/esbuild or configure in mocha options.
Update snapshots with npx esmocha --update-snapshot.
Use import syntax and ensure package.json has type: module.
Upgrade Node to supported version.
Change to import { expect } from 'esmocha' and enable ESM in your project.Use import { expect } from 'esmocha' rather than import expect from 'esmocha'.Run npm install @node-loaders/esbuild --save-dev.