karma-runner / karma-commonjs

A Karma plugin. Test CommonJS modules.
MIT License
73 stars 30 forks source link

fix: allow cycles in module dependencies #6

Closed pkozlowski-opensource closed 11 years ago

pkozlowski-opensource commented 11 years ago

Although hardly a good practice it might happen that we can have cycles in module dependencies. Node.js is handling this situation as described here: http://nodejs.org/api/modules.html#modules_cycles The simple fix from this commit allows similar behavior.

On the project I'm playing with I've bumped into such situation that was handled correctly by a module loader we are using but failed with stack overflow while using this plugin.

jamesshore commented 11 years ago

Nice catch!