diff --git a/package.json b/package.json index 562a182a8c..e72c03f97b 100644 --- a/package.json +++ b/package.json @@ -309,7 +309,7 @@ "dependencies": { "browser-stdout": "1.3.0", "commander": "2.9.0", - "debug": "2.6.0", + "debug": "2.6.8", "diff": "3.2.0", "escape-string-regexp": "1.0.5", "glob": "7.1.1", diff --git a/test/integration/helpers.js b/test/integration/helpers.js index 025770dd6b..179ecc1b17 100644 --- a/test/integration/helpers.js +++ b/test/integration/helpers.js @@ -2,7 +2,6 @@ var spawn = require('child_process').spawn; var path = require('path'); -var fs = require('fs'); var baseReporter = require('../../lib/reporters/base'); module.exports = { @@ -41,47 +40,6 @@ module.exports = { }); }, - /** - * Invokes the mocha binary on the code of the body of the function. - * Accepts an array of additional command line args to pass. The callback is - * invoked with a summary of the run, in addition to its output. The summary - * includes the number of passing, pending, and failing tests, as well as the - * exit code. Useful for testing different reporters. - * - * Example response: - * { - * pending: 0, - * passing: 0, - * failing: 1, - * code: 1, - * output: '...' - * } - * - * @param {function} fixture - * @param {array} args - * @param {function} fn - */ - runMochaFunction: function (fixture, args, fn) { - var path = resolveFixturePath(fixture.name + '.js' || 'tempfile.js'); - args = args || []; - - var fixtureContent = 'var fn = ' + fixture.toString() + '; fn()'; - fs.writeFileSync(path, fixtureContent, 'utf8'); - - function cleanup () { - fs.unlink(path); - fn.apply(this, arguments); - } - - invokeMocha(args.concat(['-C', path]), function (err, res) { - if (err) { - return cleanup(err); - } - - cleanup(null, getSummary(res)); - }); - }, - /** * Invokes the mocha binary for the given fixture using the JSON reporter, * returning the parsed output, as well as exit code. @@ -157,10 +115,12 @@ module.exports = { function invokeMocha (args, fn) { var output, mocha, listener; - + // ensure DEBUG doesn't kill tests + var env = Object.assign({}, process.env); + delete env.DEBUG; output = ''; args = [path.join('bin', 'mocha')].concat(args); - mocha = spawn(process.execPath, args); + mocha = spawn(process.execPath, args, {env: env}); listener = function (data) { output += data;