# @nomicfoundation/hardhat-chai-matchers

> Hardhat utils for testing

Latest version **3.0.0** (published 2026-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nomicfoundation/hardhat-chai-matchers
pnpm add @nomicfoundation/hardhat-chai-matchers
yarn add @nomicfoundation/hardhat-chai-matchers
bun add @nomicfoundation/hardhat-chai-matchers
```

## Health

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

Positive: no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-02-26 |
| First published | 2022-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8507 |
| Author | Nomic Foundation |
| Keywords | ethereum, smart-contracts, hardhat, testing |

## Links

- npm: https://www.npmjs.com/package/@nomicfoundation/hardhat-chai-matchers
- Repository: https://github.com/NomicFoundation/hardhat
- Homepage: https://github.com/nomicfoundation/hardhat/tree/deprecated-versions/packages/hardhat-chai-matchers
- Issues: https://github.com/NomicFoundation/hardhat/issues
- npm.io page: https://npm.io/package/@nomicfoundation/hardhat-chai-matchers

## 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

- 3.0.0 (latest) — 2026-02-26
- 2.1.2 (hh2) — 2025-10-30
- 1.0.7-dev.0 (dev) — 2023-04-10
- 2.0.0-beta.0 (beta) — 2023-04-03
- 2.1.1 — 2025-10-29
- 2.1.0 — 2025-07-17
- 2.0.9 — 2025-06-09
- 2.0.8 — 2024-09-19
- 2.0.7 — 2024-06-03
- 2.0.6 — 2024-02-15
- 2.0.5 — 2024-02-14
- 2.0.4 — 2024-01-30
- 2.0.3 — 2023-12-26
- 2.0.2 — 2023-08-10
- 2.0.1 — 2023-06-08
- … 13 more at https://npm.io/package/@nomicfoundation/hardhat-chai-matchers/versions

## README

# Hardhat Chai Matchers

This plugin adds Ethereum-specific capabilities to the [Chai](https://chaijs.com/) assertion library, making your smart contract tests easy to write and read.

**Version compatibility warning:** This version of the package does not work with Hardhat 2 nor 3. Please read below to migrate to Hardhat 3 or install a version compatible with Hardhat 2.

### Installation

#### Hardhat 3

To learn how to migrate to Hardhat 3, please read the [migration guide](https://hardhat.org/migrate-from-hardhat2).

#### Hardhat 2

To use this package with Hardhat 2, please install the `hh2` tag with npm or your package manager of choice:

```bash
npm install --save-dev "@nomicfoundation/hardhat-chai-matchers@hh2"
```

---
_Source: https://npm.io/package/@nomicfoundation/hardhat-chai-matchers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
