GitHub

Allure framework integration for Chai assertions

Allure Report logo


Features

  • records Chai assertions as Allure steps
  • supports expect, should, and assert styles
  • works through the sync runtime from allure-js-commons

Installation

Install allure-chai together with a Chai-compatible Allure test runner integration, such as allure-mocha:

npm install -D allure-chai allure-mocha chai

Supported versions and platforms

  • chai >= 4 < 7
  • Linux, macOS, and Windows wherever Chai and your test runner support Node.js
  • this repository is validated in CI on Node.js 20 and 22

Usage

Register allureChai with Chai before assertions run:

import * as chai from "chai";
import { allureChai } from "allure-chai";
chai.use(allureChai);
const { expect } = chai;
expect(response.status).to.equal(200);

The assertion above creates a step similar to:

expect(201).to.equal(200)

The package does not configure a test runner by itself. Use it together with an Allure adapter that provides the runtime, for example allure-mocha.

Read the original on github.com ↗