From dd378f0a2fbadee3a2cd3d05b84aa0caec975684 Mon Sep 17 00:00:00 2001 From: Alexis Kofman Date: Wed, 27 Apr 2016 11:19:04 +0200 Subject: [PATCH] Permits all mocha setup options --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 3d9aa54..01c55e3 100644 --- a/index.js +++ b/index.js @@ -7,12 +7,13 @@ var loaderUtils = require("loader-utils"); module.exports = function() {}; module.exports.pitch = function(req) { this.cacheable && this.cacheable(); - var query = loaderUtils.parseQuery(this.query); var source = []; + var query = loaderUtils.parseQuery(this.query); + query.ui = query.ui || 'bdd'; if(this.target == "web") { source.push("require(" + JSON.stringify("!!" + path.join(__dirname, "web.js")) + ");"); source.push("if(typeof window !== 'undefined' && window.initMochaPhantomJS) { window.initMochaPhantomJS(); }"); - source.push("mocha.setup(" + JSON.stringify(query["interface"] || "bdd") + ");"); + source.push("mocha.setup(" + JSON.stringify(query) + ");"); source.push("require(" + JSON.stringify("!!" + req) + ")"); source.push("require(" + JSON.stringify("!!" + path.join(__dirname, "start.js")) + ");"); source.push("if(module.hot) {");