talira

gulp-mocha

Run Mocha tests from a gulp task

open sourceMITfree

gulp-mocha is a gulp plugin that runs Mocha tests from a gulp task: you pipe test file paths into it, and it passes its options straight to the mocha binary, camelCased, with arrays and objects converted to the format Mocha expects. Its README calls it a thin wrapper around Mocha. Install it from npm as gulp-mocha.

Problems it solves

  • run my Mocha tests as part of a gulp build
  • add a test step to an existing gulpfile
  • fail a gulp task when Mocha tests fail

Features

  • runs Mocha from a gulp pipeline
  • passes any Mocha command-line option, camelCased
  • ui, reporter, timeout, bail, grep and require options

Limitations

  • It needs file paths, so no other gulp plugin can come before it in the pipe.1

Alternatives

The same job

These do what gulp-mocha does.

  1. gulp-sourcemaps Source map support for gulp builds

Compare gulp-mocha with the top 3