Skip to content

Commit 8421974

Browse files
authored
fix(browser): stop using all global vars in 'browser-entry' (#4746)
1 parent 27bfc74 commit 8421974

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

browser-entry.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,4 @@ Mocha.process = process;
213213
global.Mocha = Mocha;
214214
global.mocha = mocha;
215215

216-
// this allows test/acceptance/required-tokens.js to pass; thus,
217-
// you can now do `const describe = require('mocha').describe` in a
218-
// browser context (assuming browserification). should fix #880
219-
module.exports = Object.assign(mocha, global);
216+
module.exports = mocha;

lib/cli/watch-run.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ exports.watchParallelRun = (
4646

4747
// this `require` is needed because the require cache has been cleared. the dynamic
4848
// exports set via the below call to `mocha.ui()` won't work properly if a
49-
// test depends on this module (see `required-tokens.spec.js`).
49+
// test depends on this module.
5050
const Mocha = require('../mocha');
5151

5252
// ... and now that we've gotten a new module, we need to use it again due
@@ -108,7 +108,7 @@ exports.watchRun = (mocha, {watchFiles, watchIgnore}, fileCollectParams) => {
108108

109109
// this `require` is needed because the require cache has been cleared. the dynamic
110110
// exports set via the below call to `mocha.ui()` won't work properly if a
111-
// test depends on this module (see `required-tokens.spec.js`).
111+
// test depends on this module.
112112
const Mocha = require('../mocha');
113113

114114
// ... and now that we've gotten a new module, we need to use it again due

test/browser-specific/setup.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ global.expect = require('unexpected')
88
.use(require('unexpected-map'))
99
.use(require('unexpected-sinon'))
1010
.use(require('unexpected-eventemitter'));
11+
12+
require('../../browser-entry');

test/unit/required-tokens.spec.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)