You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.
It turns out this is an issue with Browserify, which is used to package Mocha for the browser. Mocha simply assigns global.mocha = ... and Browserify injects the first defined of global, self and window as global. In most browsers, global isn't defined, so window.mocha ends up being defined, which is what you want. But in NW.js both global and window are defined (because NW.js puts global on window.global) so Mocha ends up defined at global.mocha which is the wrong context. It also defines global.describe, global.it, etc. which in the browser should all be on window to work.
Just like this question I'm trying to run Mocha tests via Karma in NW.js.
However my tests aren't running as
window.mocha
isn't defined.Is it possible to do something like
window.mocha = window.mocha || require("mocha")
in the Adapter? Any other tips/suggestions.The text was updated successfully, but these errors were encountered: