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

2.0.0-beta.3 • Public • Published

allure-mochajs

This project implements Allure integration with Mocha framework.

Installation

npm i allure-mochajs mocha --save-dev

or via yarn:

yarn add allure-mochajs mocha --dev

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

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

Allure types configuration

Add the following into your tsconfig.json to access exported Allure types.

    "typeRoots"[
      "./node_modules/allure-js-commons/dist/declarations/**/"
    ]

Usage

Either add allure-mochajs into mocha.opts:

--ui mocha-typescript
--require source-map-support/register
--reporter allure-mochajs

Or pass the same value via commandline / scripts:

mocha -R allure-mochajs

Now you can access a global allure object from within your project:

const allure: AllureInterface = global.allure;

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.

Readme

Keywords

Package Sidebar

Install

npm i allure-mochajs

Weekly Downloads

2

Version

2.0.0-beta.3

License

Apache-2.0

Unpacked Size

36.8 kB

Total Files

18

Last publish

Collaborators

  • qameta-bot
  • baev
  • eroshenkoam