Skip to content

Commit 2b8a1ff

Browse files
irrationnelleboneskull
authored andcommitted
fix: add Mocha to global variable
1 parent 78d979d commit 2b8a1ff

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

rollup.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const config = {
1717
file: './mocha.js',
1818
format: 'umd',
1919
sourcemap: true,
20-
name: 'mocha'
20+
name: 'mocha',
21+
footer: 'window.Mocha = window.mocha.Mocha;'
2122
},
2223
plugins: [
2324
json(),

test/browser-specific/esm.spec.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ import './fixtures/esm.fixture.mjs';
33
it('should register a global if it did not fail', function() {
44
expect(window.MOCHA_IS_OK, 'to be ok');
55
});
6+
7+
it('should has global Mocha', function() {
8+
expect(window.Mocha, 'not to be', undefined);
9+
});

0 commit comments

Comments
 (0)