From b37fb654ed88deed1c17656468aafbb49bc9f1d4 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Fri, 2 Jun 2017 23:01:15 -0700 Subject: [PATCH] upgrade to debug@2.6.8; closes #2859 - ensure we can run the test suite with `DEBUG=mocha*` by removing it when spawning `mocha` - remove some cruft in the test helpers --- package.json | 2 +- test/integration/helpers.js | 46 ++----------------------------------- 2 files changed, 3 insertions(+), 45 deletions(-) diff --git a/package.json b/package.json index e772d90290..72b20e4f45 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..c7d9c54c87 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,10 @@ module.exports = { function invokeMocha (args, fn) { var output, mocha, listener; - + // ensure DEBUG doesn't kill tests output = ''; args = [path.join('bin', 'mocha')].concat(args); - mocha = spawn(process.execPath, args); + mocha = spawn(process.execPath, args, {env: {}}); listener = function (data) { output += data;