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
Cannot find module issue with mocha.js in browser #3091
Comments
Someone will have to figure out whether our Browserify options changed or if the Browserify defaults changed in the newer version and either way how to change it back with the version we now use. (At some point, we need to get tests using Karma with an AMD loader such as RequireJS so that these get caught before releasing...) |
Yes, I added |
This became too difficult to manage on the command-line. What we're trying to do here is ship a version of the `Buffer` shim which plays well with IE9/IE10. Browserify ships with a version which does NOT play well, meaning we have to force it to use the version we choose (`buffer@4.9.x`). The fix is in two parts: 1. `insertGlobalVars` option replaces usages of global `Buffer` with `require('/path/to/mocha/node_modules/buffer').Buffer` 2. Any *other* module which explicitly requires `buffer` or, yes, `buffer/`, must *also* use `/path/to/mocha/node_modules/buffer` If *both* of these are not in place, Browserify will use its *own* version of the `buffer` shim.
@killmenot please pull down PR #3145 to test a fix |
This became too difficult to manage on the command-line. What we're trying to do here is ship a version of the `Buffer` shim which plays well with IE9/IE10. Browserify ships with a version which does NOT play well, meaning we have to force it to use the version we choose (`buffer@4.9.x`). The fix is in two parts: 1. `insertGlobalVars` option replaces usages of global `Buffer` with `require('/path/to/mocha/node_modules/buffer').Buffer` 2. Any *other* module which explicitly requires `buffer` or, yes, `buffer/`, must *also* use `/path/to/mocha/node_modules/buffer` If *both* of these are not in place, Browserify will use its *own* version of the `buffer` shim.
- this will assert that using `import` with `mocha.js` does not break - fix: remove missing `Makefile` target; add `test-browser-esm` target - fix: update invalid comments regarding running SauceLabs locally in `karma.conf` - fix: break if attempting to run Karma on AppVeyor - refactor Karma test flags to all use `MOCHA_TEST` env var - a few reformats Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
@boneskull PR #3145 fixes this issue. Thank you |
closing this as it is fixed by dropping ie9 and ie10 support (fixed by #3164) |
Hi,
I'm using mocha with requirejs for browser testing and got a weird issue when updated to 4.0.1.
By some reason I got the following issue when run tests:
You can find the code that reproduce the issue here: https://github.com/killmenot/mocha-cannot-find-module-issue (just do
npm install
and then open testrunner.html in browser or runnpm run test
)I took a look at mocha.js (I run
make mocha.js
) I found the following:When I remove
require=
from mocha.js file the test works fine.Any advices?
The text was updated successfully, but these errors were encountered: