# @japa/expect

> Assertion package built on top of Jest expect

Latest version **3.0.7** (published 2025-12-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @japa/expect
pnpm add @japa/expect
yarn add @japa/expect
bun add @japa/expect
```

## Health

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

Positive: esm support; no vulnerabilities; has provenance.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.7 |
| Published | 2025-12-13 |
| First published | 2022-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=18.16.0 |
| Dependencies | 1 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 6 |
| Author | Harminder Virk |
| Maintainers | virk, romainlanz, julien-r44 |
| Keywords | expect, jest, japa |

## Links

- npm: https://www.npmjs.com/package/@japa/expect
- Repository: https://github.com/japa/expect
- Homepage: https://github.com/japa/expect#readme
- Issues: https://github.com/japa/expect/issues
- npm.io page: https://npm.io/package/@japa/expect

## Dependencies (1)

- [expect](https://npm.io/package/expect.md) ^30.2.0

## Recent versions

- 3.0.7 (latest) — 2025-12-13
- 3.0.0-1 (next) — 2023-09-25
- 3.0.6 — 2025-07-24
- 3.0.5 — 2025-07-21
- 3.0.4 — 2025-05-15
- 3.0.3 — 2025-01-08
- 3.0.2 — 2024-03-29
- 3.0.1 — 2023-12-16
- 3.0.0 — 2023-10-07
- 3.0.0-0 — 2023-06-28
- 2.0.2 — 2023-02-07
- 2.0.1 — 2022-09-08
- 2.0.0 — 2022-09-03
- 1.1.4 — 2022-04-02
- 1.1.3 — 2022-03-23
- … 5 more at https://npm.io/package/@japa/expect/versions

## README

# @japa/expect
> Assertion library built on top of jest-expect

[![github-actions-image]][github-actions-url] [![npm-image]][npm-url] [![license-image]][license-url] [![typescript-image]][typescript-url]

An assertion library built on top of [jest-expect](https://jestjs.io/docs/expect).

#### [Complete API documentation](https://japa.dev/docs/plugins/expect)

## Installation
Install the package from the npm registry as follows:

```sh
npm i @japa/expect
```

```sh
yarn add @japa/expect
```

## Usage
You can use the assertion package with the `@japa/runner` as follows.

```ts
import { expect } from '@japa/expect'
import { configure } from '@japa/runner'

configure({
  plugins: [expect()]
})
```

Once done, you will be able to access the `expect` property on the test context.

```ts
test('test title', ({ expect }) => {
  expect(100).toBeWithinRange(90, 110)
})
```

[github-actions-url]: https://github.com/japa/expect/actions/workflows/checks.yml "github-actions"

[github-actions-image]: https://img.shields.io/github/actions/workflow/status/japa/expect/checks.yml?style=for-the-badge

[npm-image]: https://img.shields.io/npm/v/@japa/expect.svg?style=for-the-badge&logo=npm
[npm-url]: https://npmjs.org/package/@japa/expect "npm"

[license-image]: https://img.shields.io/npm/l/@japa/expect?color=blueviolet&style=for-the-badge
[license-url]: LICENSE.md "license"

[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
[typescript-url]:  "typescript"

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