New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

gulp-mocha

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-mocha

Run Mocha tests

99

Supply Chain Security

98

Quality

79

Maintenance

100

Vulnerabilities

100

License


Version published
Maintainers
1
Created
Issues
11

gulp-mocha Build Status

Run Mocha tests

Keep in mind that this is just a thin wrapper around Mocha and your issue is most likely with Mocha.

Install

$ npm install --save-dev gulp-mocha

Usage

var gulp = require('gulp');
var mocha = require('gulp-mocha');

gulp.task('default', function () {
	return gulp.src('test.js', {read: false})
		.pipe(mocha({reporter: 'nyan'}));
});

API

mocha(options)

options.ui

Type: String
Default: bdd
Values: bdd, tdd, qunit, exports

The interface to use.

options.reporter

Type: String
Default: dot
Values: reporters

The reporter that will be used.

This option can also be used to utilize third-party reporters. For example if you npm install mocha-lcov-reporter you can then do use mocha-lcov-reporter as value.

options.globals

Type: Array

Accepted globals.

options.timeout

Type: Number
Default: 2000

Test-case timeout in milliseconds.

options.bail

Type: Boolean
Default: false

Bail on the first test failure.

options.ignoreLeaks

Type: Boolean
Default: false

Ignore global leaks.

options.grep

Type: String

Only run tests matching the given pattern which is internally compiled to a RegExp.

CoffeeScript

For CoffeeScript support, add require('coffee-script') with CoffeeScript 1.6- or require('coffee-script/register') with CoffeeScript 1.7+.

License

MIT © Sindre Sorhus

FAQs

Package last updated on 25 Jul 2014

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