Closed
Description
🐛 Bug Report
The expect
NPM package is not usable in browser, although it has a browser: build-es5/index.js
field.
To Reproduce
Add this to a static page:
<script src="/node_modules/expect/build-es5/index.js"></script>
It almost works, with the sole exception that the very last line fails:
module.exports = expect
Because there's no global module
object.
Expected behavior
Should not throw and expose a global expect
object.
If you detect that there's no module
but a window
instead, doing window.expect = expect
makes everything work perfectly.