https://github.com/japa/assert
Assertions package for Japa. Built on top of Chai.Assert
https://github.com/japa/assert
assert plugin
Last synced: 9 months ago
JSON representation
Assertions package for Japa. Built on top of Chai.Assert
- Host: GitHub
- URL: https://github.com/japa/assert
- Owner: japa
- License: mit
- Created: 2022-01-10T05:50:28.000Z (almost 4 years ago)
- Default Branch: 4.x
- Last Pushed: 2025-01-07T11:17:24.000Z (12 months ago)
- Last Synced: 2025-03-25T09:50:22.530Z (9 months ago)
- Topics: assert, plugin
- Language: TypeScript
- Homepage: https://japa.dev/docs/plugins/assert
- Size: 407 KB
- Stars: 8
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# @japa/assert
> Assertion library built on top of Chai.assert
[![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 [Chai.assert](https://www.chaijs.com/guide/styles/#assert) with small tweaks and additional features like assertion planning.
#### [Complete API documentation](https://japa.dev/docs/plugins/assert)
## Installation
Install the package from the npm registry as follows:
```sh
npm i @japa/assert
yarn add @japa/assert
```
## Usage
You can use the assertion package with the `@japa/runner` as follows.
```ts
import { assert } from '@japa/assert'
import { configure } from '@japa/runner'
configure({
plugins: [assert()]
})
```
Once done, you will be able to access the `assert` property on the test context.
```ts
test('test title', ({ assert }) => {
assert.deepEqual({ id: 1 }, { id: 1})
})
```
[github-actions-url]: https://github.com/japa/assert/actions/workflows/checks.yml
[github-actions-image]: https://img.shields.io/github/actions/workflow/status/japa/assert/checks.yml?style=for-the-badge "github-actions"
[npm-image]: https://img.shields.io/npm/v/@japa/assert.svg?style=for-the-badge&logo=npm
[npm-url]: https://npmjs.org/package/@japa/assert "npm"
[license-image]: https://img.shields.io/npm/l/@japa/assert?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"