Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

allure-mocha

Package Overview
Dependencies
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

allure-mocha

Allure Mocha integration

  • 3.0.0-beta.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
decreased by-50.64%
Maintainers
3
Weekly downloads
 
Created
Source

allure-mocha

Allure framewok integration for Mocha framework

Allure Report logo


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:

const { epic } = require("allure-js-commons");

it("is a test", async () => {
  await epic("Some info");
});

Parameters usage

const { parameter } = require("allure-js-commons");

it("is a test", async () => {
  await parameter("parameterName", "parameterValue");
});

The parameter method may also take the third argument with the hidden and excluded options: mode: "hidden" | "masked" - masked replaces the value with * characters to secure sensitive data, and hidden hides the parameter from report.

excluded: true - excludes the parameter from the history.

import { parameter } from "allure-js-commons";

it("is a test", async () => {
  await parameter("parameterName", "parameterValue", {
    mode: "hidden",
    excluded: true,
  });
});

Decorators Support

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

Examples

mocha-allure-example - a minimal setup for using Mocha with Allure.

Keywords

FAQs

Package last updated on 02 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc