karma-runner/karma-commonjs — pull request #30 by pkozlowski-opensource (2014-07-27 14:17:34+00:00)
Title: feat: load from the node_modules folder hierarchy

Fixes #21

This is the last step in supporting node's algorithm for loading modules. With this change we are going to look into the `node_modules` subfolder of a requiring file and traverse folders hierarchy upwards till a required file is found. I'm going to keep the "root folder" setting for now as it might be used to override certain modules in testing, for example.

This commit concludes several-months effort of making karma's load algorithm as close to the node's one as possible. The only remaining part is dealing with native modules but I don't think this is something we want to support. At least personally I don't have use-case for it.

There are probably corner cases not covered and the implementation could be better but well, we will deal with those issues as they surface.