karma-runner / karma-commonjs

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

feat: resolve depndencies on modules from a configured root #10

Closed pkozlowski-opensource closed 10 years ago

pkozlowski-opensource commented 10 years ago

This commit is a first shoot at resolving non-relative and non-absolute path from a configured "root folder" (defaulting to node_modules). It covers part of the node.js resolution module described in the "File Modules" section of http://nodejs.org/api/modules.html#modules_folders_as_modules

Without a leading '/' or './' to indicate a file, the module is either a "core module" or is loaded from a node_modules folder.

pkozlowski-opensource commented 10 years ago

@vojtajina @jamesshore I'm still new to the whole Karma ecosystem so would very much appreciate review here. This is a type of change I need for my current project and while it is far from implementing the whole node.js algorithm it has 2 advantages:

I'm leaving some other comments in the code for the parts where I have some uneasy feelings...

jamesshore commented 10 years ago

Okay, finished the review!

pkozlowski-opensource commented 10 years ago

@jamesshore awesome, thnx so much for all the valuable input! I'm going to work through all the items in the coming days and going to push updated commits. Once again, thnx for your time.

pkozlowski-opensource commented 10 years ago

@jamesshore Once again thx for the very detailed review. I think I've addressed all your suggestions in a new PR: https://github.com/karma-runner/karma-commonjs/pull/12

Closing this one, let's move the discussion to #12