Skip to content

Commit

Permalink
fix(browser): remove token requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
PaperStrike committed Sep 16, 2021
1 parent 552c208 commit dda9148
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 42 deletions.
28 changes: 0 additions & 28 deletions browser-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,32 +213,4 @@ Mocha.process = process;
global.Mocha = Mocha;
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
[
'Mocha',
'after',
'afterEach',
'before',
'beforeEach',
'context',
'describe',
'it',
'mocha',
'run',
'setup',
'specify',
'suite',
'suiteSetup',
'suiteTeardown',
'teardown',
'test',
'xcontext',
'xdescribe',
'xit',
'xspecify'
].forEach(function(key) {
if (key in global) mocha[key] = global[key];
});
module.exports = mocha;
4 changes: 2 additions & 2 deletions lib/cli/watch-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exports.watchParallelRun = (

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

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

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

// ... and now that we've gotten a new module, we need to use it again due
Expand Down
2 changes: 2 additions & 0 deletions test/browser-specific/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ global.expect = require('unexpected')
.use(require('unexpected-map'))
.use(require('unexpected-sinon'))
.use(require('unexpected-eventemitter'));

require('../../browser-entry');
12 changes: 0 additions & 12 deletions test/unit/required-tokens.spec.js

This file was deleted.

0 comments on commit dda9148

Please sign in to comment.