xdissent/karma-browserify — pull request #9 by refractalize (2013-10-21 11:32:33+00:00)
Title: some files aren't loaded into karma on first run

Oh dear, not sure how I'm going to report this one...

Anyway, I'm finding that some browserified files aren't loaded into karma on first run. This results in some tests not being run when karma is first started. On inspection it turns out that the call to `depsBundle.bundle`, [here](https://github.com/xdissent/karma-browserify/blob/master/src/index.coffee#L35), calls the callback more times than the function is called. That is, for my case, it's called 3 times, and the callback is called 5 times. More weird is that the 3rd call is never returned, the first two are returned 2-3 times each. All this says to me is that browserify isn't re-entrant, so using the same bundle to process different files asynchronously at the time time results in odd behaviour. My only suggestion being that the common dependencies between different files should be kept in a simple array, and the depsBundle be rebuilt on each new asynchronous preprocessing request.

Hope that makes sense!