Closed ekkis closed 8 years ago
karma-browserify is a preprocessor for Karma so it probably makes sense for you to read into how Karma works before asking detailed questions about karma-browserify. After all, this will help you to better understand how this plug-in works, too.
As a general note, karma-browserify helps you to test your CommonJS code without the need to bundle it first (and create a test.html
or the like). It does so by putting all files mentioned in preprocessors
into a browserified bundle. Karma will load the bundle + generated test stubs in its own html page.
Please check out README and the provided example to learn more about this project and how to use it.
I had read the README in its entirety but it doesn't explain enough for me to figure out how to use it... but I think t's because I don't understand karma well enough. thanks for the reply.
@ekkis Same here. My config is ok according to the readme, and according to the debug the module file was added to the bundle and served, but still I cannot load it with require("./thefile")
.
I read through this thread: https://github.com/nikku/karma-browserify/issues/50 and got a little further but I'm still having issues. first, my
karma.conf.js
(not complete):so one thing I don't understand is how karma tells phantomJs what to run. I have a
tests/browser/test.html
page that includes the browserisedtests/browser/tests.js
(which you'll notice includes my source and the tests), which myGruntfile.js
tags via:the other thing I don't understand is how to specify what gets browserified. the last stanza in the
karma.conf.js
came from my workingGruntfile.js
but I have a feeling is wrong since (presumably) thefiles
andpreprocessors
clauses are supposed to direct that. the docs really give me no clue.so here's the aim: collect all the
src/*.js
andtests/browser/*.js
intotests/browser/tests.js
and have phantomJS runtests/browser/test.html
can anyone help? oh yeah... at present I'm getting these errors: