Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add Mocha to global variable #4401

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion rollup.config.js
Expand Up @@ -17,7 +17,8 @@ const config = {
file: './mocha.js',
format: 'umd',
sourcemap: true,
name: 'mocha'
name: 'mocha',
footer: 'window.Mocha = window.mocha.Mocha;'
},
plugins: [
json(),
Expand Down
4 changes: 4 additions & 0 deletions test/browser-specific/esm.spec.mjs
Expand Up @@ -3,3 +3,7 @@ import './fixtures/esm.fixture.mjs';
it('should register a global if it did not fail', function() {
expect(window.MOCHA_IS_OK, 'to be ok');
});

it('should has global Mocha', function() {
expect(window.Mocha, 'not to be', undefined);
});