karma-runner / karma-commonjs

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

docs(README): Update karma-browserify comparison #39

Closed bendrucker closed 9 years ago

bendrucker commented 9 years ago

Quick update to #38. We finally got things together to take over the karma-browserify name.

jamesshore commented 9 years ago

Here's a rewrite of the comparison to make it easier to understand the tradeoff, and to provide a direct mapping between the two:


If you're using Browserify to compile your projects, you should consider 
[karma-browserify](https://github.com/Nikku/karma-browserify) which runs Browserify 
directly. The cost is slightly slower builds (but not too bad, thanks to an incremental 
loading algorithm) and somewhat messier stack traces. The benefit is support for the 
full Browserify API and automatic discovery of 'require'd files.

#### karma-commonjs
1. Provides a lightweight commonjs wrapper around your code
2. Supports Node's `require` algorithm
3. Only reloads files that change
4. Provides stack traces that point to your original files
5. Requires you to specify files in the Karma config file

#### karma-browserify
1. Creates a temporary bundle using Browserify
2. Supports the full Browserify API, including transforms, plugins, and shims for Node globals
3. Uses [watchify](https://github.com/substack/watchify) to perform incremental rebuilds
4. Can use source maps to provide useful stack traces
5. Automatically includes required files
bendrucker commented 9 years ago

Very well said! Amended.

jamesshore commented 9 years ago

Thanks. I'll let @pkozlowski-opensource make the final call on merging this.

pkozlowski-opensource commented 9 years ago

This sounds about right to me. Going to merge it later today.