diff --git a/browser-entry.js b/browser-entry.js index dee3789231..309fb7e4e6 100644 --- a/browser-entry.js +++ b/browser-entry.js @@ -216,4 +216,29 @@ global.mocha = mocha; // this allows test/acceptance/required-tokens.js to pass; thus, // you can now do `const describe = require('mocha').describe` in a // browser context (assuming browserification). should fix #880 -module.exports = Object.assign(mocha, global); +[ + 'Mocha', + 'after', + 'afterEach', + 'before', + 'beforeEach', + 'context', + 'describe', + 'it', + 'mocha', + 'run', + 'setup', + 'specify', + 'suite', + 'suiteSetup', + 'suiteTeardown', + 'teardown', + 'test', + 'xcontext', + 'xdescribe', + 'xit', + 'xspecify' +].forEach(function(key) { + mocha[key] = global[key]; +}); +module.exports = mocha;