Allure framework integration for Chai assertions
- Learn more about Allure Report at https://allurereport.org
- 📚 Documentation – discover official documentation for Allure Report
- ❓ Questions and Support – get help from the team and community
- 📢 Official annoucements – be in touch with the latest updates
- 💬 General Discussion – engage in casual conversations, share insights and ideas with the community
Features
- records Chai assertions as Allure steps
- supports
expect,should, andassertstyles - 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.