# mocha-express

> Minimal test runner for Mocha in the browser

Latest version **0.5.3** (published 2025-12-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install mocha-express
pnpm add mocha-express
yarn add mocha-express
bun add mocha-express
```

Provides the command `mocha-express`.

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.5.3 |
| Published | 2025-12-01 |
| First published | 2022-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 13 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | defx |
| Maintainers | defx |
| Keywords | test, runner, mocha, browser, websocket, coverage |

## Links

- npm: https://www.npmjs.com/package/mocha-express
- Repository: https://github.com/defx/mocha-express
- Homepage: https://github.com/defx/mocha-express#readme
- Issues: https://github.com/defx/mocha-express/issues
- npm.io page: https://npm.io/package/mocha-express

## Dependencies (13)

- [ws](https://npm.io/package/ws.md) ^8.5.0
- [chai](https://npm.io/package/chai.md) ^6.2.1
- [mocha](https://npm.io/package/mocha.md) ^9.2.1
- [yargs](https://npm.io/package/yargs.md) ^17.3.1
- [globby](https://npm.io/package/globby.md) ^13.1.1
- [express](https://npm.io/package/express.md) ^4.17.2
- [v8-to-istanbul](https://npm.io/package/v8-to-istanbul.md) ^8.1.1
- [chrome-launcher](https://npm.io/package/chrome-launcher.md) ^0.15.0
- [istanbul-reports](https://npm.io/package/istanbul-reports.md) ^3.1.4
- [mocha-ws-reporter](https://npm.io/package/mocha-ws-reporter.md) ^0.1.4
- [istanbul-lib-report](https://npm.io/package/istanbul-lib-report.md) ^3.0.0
- [istanbul-lib-coverage](https://npm.io/package/istanbul-lib-coverage.md) ^3.2.0
- [chrome-remote-interface](https://npm.io/package/chrome-remote-interface.md) ^0.31.2

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.5.3 (latest) — 2025-12-01
- 0.5.2 — 2025-12-01
- 0.5.1 — 2025-12-01
- 0.5.0 — 2025-12-01
- 0.4.0 — 2025-12-01
- 0.2.1 — 2025-08-13
- 0.2.0 — 2025-08-13
- 0.1.5 — 2025-08-13
- 0.1.4 — 2024-04-12
- 0.1.3 — 2023-05-16
- 0.1.2 — 2022-02-24
- 0.1.1 — 2022-02-24
- 0.1.0 — 2022-02-19

## README

# mocha-express

Browser-based JavaScript testing with Mocha over HTTP that runs on any browser and/or device.

**Key Features:**

- Built on **Mocha** and **Chai** for familiar syntax and behavior.
- Fast CI/CLI test execution via Chrome DevTools Protocol (CDP).
- **Watch mode** for instant feedback during development.
- **Code coverage** via **Istanbul**.

---

## Installation

Install as a dev dependency:

```bash
npm install --save-dev mocha-express
```

---

## Running Tests

Run all of your tests once in Chrome...

```bash
mocha-express
```

---

## Watch Mode

For fast feedback during development, enable watch mode to re-run tests whenever your code changes...

```bash
mocha-express --watch
```

---

## Code Coverage

Generate coverage reports using Istanbul:

```bash
mocha-express --coverage
```

Reports are saved in the `coverage/` directory, ready for CI integration or local inspection.

---
_Source: https://npm.io/package/mocha-express · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
