diff --git a/Gruntfile.js b/Gruntfile.js index 4c4840129f..87ad44044d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -260,7 +260,14 @@ var path = require('path'), command: 'bourbon install --path <%= paths.adminAssets %>/sass/modules/' }, coverage: { - command: './node_modules/mocha/bin/mocha --timeout 15000 --reporter html-cov > coverage.html ./core/test/blanket_coverage.js' + command: function () { + // will work on windows only if mocha is globally installed + var cmd = !!process.platform.match(/^win/) ? 'mocha' : './node_modules/mocha/bin/mocha'; + return cmd + ' --timeout 15000 --reporter html-cov > coverage.html ./core/test/blanket_coverage.js'; + }, + execOptions: { + env: 'NODE_ENV=' + process.env.NODE_ENV + } } }, diff --git a/core/test/blanket_coverage.js b/core/test/blanket_coverage.js index deabd107a6..c729acfed7 100644 --- a/core/test/blanket_coverage.js +++ b/core/test/blanket_coverage.js @@ -1,7 +1,7 @@ var blanket = require("blanket")({ "pattern": ["/core/server/", "/core/client/", "/core/shared/"], "data-cover-only": ["/core/server/", "/core/client/", "/core/shared/"] - }), +}), requireDir = require("require-dir"); requireDir("./unit");