-
Notifications
You must be signed in to change notification settings - Fork 31
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
browserify #113
Comments
(Browserify itself will replace references to |
|
@boneskull - please try that branch. |
I get
This happens when my test file does |
It'd also (theoretically) work if there was a "globals" bundle of rewiremock available. Then I could make it work in Karma by throwing it in a |
(That branch works when running in node, just not in karma/karma-browserify) |
Sounds like a problem with browserify module system, if it even exists. So:
Gonna double check how browserify works today... |
Look like there is no implementation of a real module system, as long as it's not really needed in "runtime". |
K, thanks for looking in to this. I think Mocha is moving to webpack anyway. not sure if you meant to leave this open. |
I was wrong; we're not going to use webpack--looks like we're going to use rollup instead. This doesn't mean we're going to adopt ESM modules, though, given the current set of challenges there. |
rollup's module system is a unknown for me yet. Haven't tried it, but reckon it should not be a problem.
Probably it's time to close this issue with WONT FIX, and open a new one for rollup. |
there's some stuff in the works to move Mocha way from browserify and onto webpack, but not sure when that'll land.
in the meantime, I'm struggling to get rewiremock working in a browserify bundle via karma. it's throwing an exception because
require.resolve
does not exist. first, it throws because of thenode-libs-browser
module:Even if that's addressed somehow, it will certainly throw in the two other places that use
require.resolve
in the codebase (nested.js
&mockModule.js
).For this to work, I'm going to guess you'd want to publish a browser bundle and reference it in the
browser
field ofpackage.json
--or otherwise point to a non-bundled, browser-specific implementation. But that's just my guess.But... this may be a "WONTFIX" for you--and I get it. Just something I ran into and thought it wouldn't hurt to mention.
The text was updated successfully, but these errors were encountered: