Closed spikebrehm closed 10 years ago
@spikebrehm I'm introducing karma-commonjs
into one of my project and could try to help you if you could prepare a separate repository with a minimal reproduce scenario. It is kind of hard to go over all the files in your repo right now.
Ok, thanks. Let me see how easy it is to come up with a reproducible scenario.
On a related note, it looks like I introduced a bug way back when in commonjs_bridge.js on line 9. The error message used to be more descriptive. Let's change it to say:
Could not find module '../../../app/collections/repos' ('/Users/spike/code/rendr/examples/00_simple/app/collections/repos.js') from '/Users/spike/code/rendr/examples/00_simple/test/app/collections/repos.test.js'
In other words, rather than overwriting dependency
on line 9, let's save the user's original dependency so we can report it.
Oh, this was me misunderstanding the Karma config file. The files
array has to include both application source files and test files; the config I pasted was just loading the test files.
Now my next question: what about NPM dependencies? What do we have to do so that our application files can require NPM modules?
Am I better off running Browserify to create both 'app' and 'test' bundles as a separate step, rather than trying to use karma-commonjs
?
@pkozlowski-opensource has been working on supporting npm dependencies, but it isn't ready yet. See #10.
Thanks. I'm going to close for now, presuming I'll be using karma-browserify
.
Hello,
I just switched a project over to using
karma-commonjs
, but i'm seeing an issue where a required module isn't found. Perhaps you may know how to fix it?https://github.com/airbnb/rendr/compare/karma-commonjs
The error I'm getting is:
Which is strange because is the file is certainly there:
You can see the test file,
repos.test.js
, here:https://github.com/airbnb/rendr/blob/42e160e212ceee333ae93b2742ef1cdfb61ac485/examples/00_simple/test/app/collections/repos.test.js
Any thoughts?