Wondering what’s next for npm?Check out our public roadmap! »

    allure-mocha
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0-beta.9 • Public • Published

    allure-mocha

    This project implements Allure integration with Mocha framework.

    Installation

    npm i allure-mocha mocha --save-dev

    or via yarn:

    yarn add allure-mocha mocha --dev

    Note that it's recommended to add the following dependencies as well for better user experience:

    • typescript
    • mocha-typescript
    • source-map-support

    Usage

    Either add allure-mocha into mocha.opts:

    --reporter allure-mocha
    

    Or pass the same value via commandline / scripts:

    mocha -R allure-mocha

    If you want to provide extra information, such as steps and attachments, import the allure object into your code:

    // es-modules
    import { allure } from 'allure-mocha/runtime';
    // or commonjs
    const { allure } = require('allure-mocha/runtime');
    
    it('is a test', () => {
      allure.epic('Some info');
    });

    Decorators Support

    To make tests more readable and avoid explicit API calls, you can use a special extension - ts-test-decorators.

    Examples

    See mocha-allure2-example project, which is already configured to use latest Allure 2 features with decorators support.

    Thanks

    @srg-kostyrko for help and assistance.

    Install

    npm i allure-mocha

    DownloadsWeekly Downloads

    5,918

    Version

    2.0.0-beta.9

    License

    Apache-2.0

    Unpacked Size

    39 kB

    Total Files

    20

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar