# @tapjs/asserts

> Tap plugin that adds a heaping pile of assertion methods. Pretty much all of the "test" methods other than `t.pass`, `t.fail`, and [snapshot methods](https://tapjs.github.io/tapjs/modules/_tapjs_snapshot.html) come from this plugin.

Latest version **4.3.12** (published 2026-09-03) · BlueOak-1.0.0 license · 0 weekly downloads

## Install

```sh
npm install @tapjs/asserts
pnpm add @tapjs/asserts
yarn add @tapjs/asserts
bun add @tapjs/asserts
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.3.12 |
| Published | 2026-09-03 |
| First published | 2023-08-04 |
| Weekly downloads | 0 |
| License | BlueOak-1.0.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | 20 \|\| >=22 |
| Dependencies | 4 |
| Unpacked size | 234 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2423 |
| Author | Isaac Z. Schlueter |
| Maintainers | ljharb, isaacs |
| Keywords | tapjs plugin |

## Links

- npm: https://www.npmjs.com/package/@tapjs/asserts
- Repository: https://github.com/tapjs/tapjs
- Homepage: https://github.com/tapjs/tapjs/tree/main/src/asserts#readme
- Issues: https://github.com/tapjs/tapjs/issues
- Funding: https://github.com/sponsors/isaacs
- npm.io page: https://npm.io/package/@tapjs/asserts

## Dependencies (4)

- [tcompare](https://npm.io/package/tcompare.md) 9.3.2
- [@tapjs/stack](https://npm.io/package/@tapjs/stack.md) 4.3.3
- [trivial-deferred](https://npm.io/package/trivial-deferred.md) ^2.0.0
- [is-actual-promise](https://npm.io/package/is-actual-promise.md) ^1.0.1

## Recent versions

- 4.3.12 (latest) — 2026-09-03
- 1.0.0 (pre) — 2023-09-15
- 4.3.11 — 2026-07-27
- 4.3.10 — 2026-05-15
- 4.3.9 — 2026-05-13
- 4.3.8 — 2026-05-01
- 4.3.7 — 2026-04-17
- 4.3.6 — 2026-04-15
- 4.3.5 — 2026-04-05
- 4.3.4 — 2026-02-20
- 4.3.3 — 2026-02-18
- 4.3.2 — 2026-02-18
- 4.3.1 — 2026-02-05
- 4.3.0 — 2025-12-01
- 4.2.1 — 2025-11-26
- … 76 more at https://npm.io/package/@tapjs/asserts/versions

## README

# `@tapjs/asserts`

Tap plugin that adds a heaping pile of assertion methods. Pretty
much all of the "test" methods other than `t.pass`, `t.fail`, and
[snapshot
methods](https://tapjs.github.io/tapjs/modules/_tapjs_snapshot.html)
come from this plugin.

## USAGE

This plugin is installed with tap by default. If you had
previously removed it, you can `tap plugin add @tapjs/asserts` to
bring it back.

### `compareOptions`

This plugin adds the `compareOptions` option to the set of fields
that can be passed to child tests. You can also set
`t.compareOptions` after the fact.

`compareOptions` lets you pass options to
[tcompare](https://tapjs.github.io/tapjs/modules/tcompare.html)
to specify the formatting style, diff context lines, and so on.

It can contain the following fields:

- `sort` - boolean, sort items alphabetically by key.
- `bufferChunkSize` - number of bytes to show on each line when
  printing buffers, default `32`
- `includeEnumerable` - boolean, include any and all enumerable
  properties, including those inherited on the prototype chain.
  By default, only `own` properties are shown.
- `includeGetters` - boolean, include getter properties.
- `diffContext` - how many lines of context to print around
  changes in diffs, default `10`. Note that the test reporter
  might use more or less than this value when displaying pretty
  colored diffs.

### Assertion Methods

All of the assertion methods are documented [on the `Assertions`
class](https://tapjs.github.io/tapjs/classes/_tapjs_asserts.index.Assertions.html).
When this plugin is loaded, these are all present on `Test`
objects.

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