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.
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.