karma-runner / karma-commonjs

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

Fails on modules with a shebang #43

Open jamesshore opened 9 years ago

jamesshore commented 9 years ago

If you require a module that starts with a shebang, such as #! /usr/bin/node, the code will fail with a syntax error. This is because karma-commonjs inserts its wrapper in front of the shebang, which leads to invalid code.

We should look for the presence of a shebang line and add our wrapper below it when it's present.

pkozlowski-opensource commented 9 years ago

Oh, this is a valid one... and should be relatively easy to fix!