mocha-notifier-reporter
mocha-notifier-reporter
is a reporter that shows notification using node-notifier with customizable values.
Default notification is similar to Mocha growl option.
It can also add notifications to other Mocha reporters.
Installation
npm install mocha-notifier-reporter
Usage
It's easy to show notifications from Gulp tests.
var gulp = ;var mocha = ; // stand-alone usagegulp;
Use decorate
method to use other reporter at the same time.
decorate
takes same argument as Mocha for reporter property.
See here for other possible reporters.
var gulp = ;var mocha = ;var notifierReporter = ; // stand-alone usagegulp;
Options
mocha-notifier-reporter
has few options to change notifications behavior and looks.
var notifierReporter = ;
options
property is passed to node-notifier. Except icon
, title
and message
options, which are overridden with values below.
notifierReporteroptions = {}; // options for node-notifier
Change notification icons with icon_pass
and icon_fail
properties.
notifierReportericon_pass = 'path to pass image';notifierReportericon_fail = 'path to fail image';
Title and message strings are parsed using node-printf with stats object.
Possible variables are:
suites
, tests
, passes
, pending
, failures
, total
, start
, end
, duration
notifierReportertitle_pass = 'pass title'; // defaults to 'Passed'notifierReportertitle_fail = 'fail title'; // defaults to 'Failed'notifierReportermessage_pass = 'pass message'; // defaults to '%(passes)d tests passed in %(duration)dms'notifierReportermessage_fail = 'fail message'; // defaults to '%(failures)d of %(total)d tests failed'