@japa/assert

japa
esm
@japa/assert JS library on GitHub @japa/assert JS library on npm Download @japa/assert JS library

Assertion module for Japa

Version 4.0.1 License MIT
@japa/assert has no homepage
@japa/assert JS library on GitHub
@japa/assert JS library on npm
Download @japa/assert JS library
Keywords
assertchaijapa

@japa/assert

Assertion library built on top of Chai.assert

github-actions-image npm-image license-image typescript-image

An assertion library built on top of Chai.assert with small tweaks and additional features like assertion planning.

Complete API documentation

Installation

Install the package from the npm registry as follows:

npm i @japa/assert

yarn add @japa/assert

Usage

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

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.

test('test title', ({ assert }) => {
  assert.deepEqual({ id: 1 }, { id: 1})
})