Skip to content

Commit

Permalink
fix: add Mocha to global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
irrationnelle authored and boneskull committed Aug 14, 2020
1 parent 78d979d commit 2b8a1ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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);
});

0 comments on commit 2b8a1ff

Please sign in to comment.