mocha-metatitles

2.0.1 • Public • Published

mocha-metatitles

Travis Build NPM Version NPM Downloads

Add metadata to mocha test titles.

Sample usage

Build some test types and make them globally available

const mochaTestType = require('mocha-metatitles');
 
global.slowTest = mochaTestType('slow');
global.fastTest = mochaTestType('fast');

Use test types like the describe function from mocha:

fastTest('Fast test title:', () => {
  it('should work correctly and be fast', () => {
    // empty
  });
}

Features

  • Test titles with test type and file path

test-screenshot

  • Easy grep through test types

grep-screenshot

  • Setup conditional test execution using options.argv parameter. See more options
const mochaTestType = require('mocha-metatitles');
const slowTest = mochaTestType('slow', { argv: { slowTests: true} });
 
slowTest('Slow test:', () => {
  it('Runs only on command line parameter slowTests=true', () => {
    // empty
  });
}

Readme

Keywords

none

Package Sidebar

Install

npm i mocha-metatitles

Weekly Downloads

2

Version

2.0.1

License

WTFPL

Last publish

Collaborators

  • mendlik