mocha-metatitles
v2.0.1
Published
[![Travis Build](https://img.shields.io/travis/coditorium/nodejs-mocha-metatitles.svg?style=flat-square)](https://travis-ci.org/coditorium/nodejs-mocha-metatitles) [![NPM Version](https://img.shields.io/npm/v/mocha-metatitles.svg?style=flat-square)](http:
Downloads
14
Readme
mocha-metatitles
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
- Easy grep through test types
- 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
});
}