gulp-mocha
Advanced tools
Comparing version 4.3.0 to 4.3.1
23
index.js
@@ -8,5 +8,11 @@ 'use strict'; | ||
const npmRunPath = require('npm-run-path'); | ||
const utils = require('./utils'); | ||
const HUNDRED_MEGABYTES = 1000 * 1000 * 100; | ||
// Mocha options that can be specified multiple times | ||
const MULTIPLE_OPTS = new Set([ | ||
'require' | ||
]); | ||
module.exports = opts => { | ||
@@ -18,3 +24,2 @@ opts = Object.assign({ | ||
// Convert arrays into comma separated lists | ||
for (const key of Object.keys(opts)) { | ||
@@ -24,3 +29,9 @@ const val = opts[key]; | ||
if (Array.isArray(val)) { | ||
opts[key] = val.join(','); | ||
if (!MULTIPLE_OPTS.has(key)) { | ||
// Convert arrays into comma separated lists | ||
opts[key] = val.join(','); | ||
} | ||
} else if (typeof val === 'object') { | ||
// Convert an object into comma separated list | ||
opts[key] = utils.convertObjectToList(val); | ||
} | ||
@@ -58,6 +69,6 @@ } | ||
}) | ||
.catch(err => { | ||
this.emit('error', new gutil.PluginError('gulp-mocha', err)); | ||
done(); | ||
}); | ||
.catch(err => { | ||
this.emit('error', new gutil.PluginError('gulp-mocha', err)); | ||
done(); | ||
}); | ||
@@ -64,0 +75,0 @@ if (!opts.suppress) { |
{ | ||
"name": "gulp-mocha", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"description": "Run Mocha tests", | ||
@@ -16,6 +16,7 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "xo && mocha" | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"utils.js" | ||
], | ||
@@ -45,11 +46,7 @@ "keywords": [ | ||
"devDependencies": { | ||
"ava": "*", | ||
"gulp": "^3.9.1", | ||
"p-event": "^1.0.0", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"envs": [ | ||
"node", | ||
"mocha" | ||
] | ||
} | ||
} |
7103
5
81
4