Skip to content

Instantly share code, notes, and snippets.

Created November 5, 2015 12:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Pass an argument to Gulp to only run a subset of Specs
"use strict";
const gulp = require('gulp'),
mocha = require('gulp-mocha'),
minimist = require('minimist');
const knownOptions = {
string: 'spec',
default: { spec: '*' }
const options = minimist(process.argv.slice(2), knownOptions);
gulp.task('test', ['hint'], () => {
return gulp.src([`test/**/${options.spec}Spec.js`], {read: false}) // String interpolation FTW!
gulp.task('default', ['test']);
$ gulp test --spec foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment