Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #30 from akofman/master
Browse files Browse the repository at this point in the history
Permits all mocha setup options
  • Loading branch information
jankanty authored Aug 17, 2016
2 parents 2f3642b + dd378f0 commit 0826e67
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {");
Expand Down

0 comments on commit 0826e67

Please sign in to comment.