karma-runner/karma-commonjs — pull request #5 by pkozlowski-opensource (2013-11-27 09:41:09+00:00)
Title: fix: allow module files with // comments at the end

This plugin wraps each module's content in a function call and does so without new lines (to preserve line numbers). But this mechanism will fail if module content ends with `// some comment` as it will result in `// some comment }` in a wrapped file, breaking the wrapping function.

The solution is to use a line break (OS-dependent) before the closing wrapping bracket. This shouldn't mess up line numbers as we are talking about the end of the original file here.