Skip to content

Commit c2290f0

Browse files
committed
fix(browser): stop using all global vars when init
1 parent 4860738 commit c2290f0

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

browser-entry.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,29 @@ global.mocha = mocha;
216216
// this allows test/acceptance/required-tokens.js to pass; thus,
217217
// you can now do `const describe = require('mocha').describe` in a
218218
// browser context (assuming browserification). should fix #880
219-
module.exports = Object.assign(mocha, global);
219+
[
220+
'Mocha',
221+
'after',
222+
'afterEach',
223+
'before',
224+
'beforeEach',
225+
'context',
226+
'describe',
227+
'it',
228+
'mocha',
229+
'run',
230+
'setup',
231+
'specify',
232+
'suite',
233+
'suiteSetup',
234+
'suiteTeardown',
235+
'teardown',
236+
'test',
237+
'xcontext',
238+
'xdescribe',
239+
'xit',
240+
'xspecify'
241+
].forEach(function(key) {
242+
mocha[key] = global[key];
243+
});
244+
module.exports = mocha;

0 commit comments

Comments
 (0)