diff --git a/test/parallel/test-internal-modules-strip-shebang.js b/test/parallel/test-internal-modules-strip-shebang.js new file mode 100644 index 00000000000000..93be3d41981f50 --- /dev/null +++ b/test/parallel/test-internal-modules-strip-shebang.js @@ -0,0 +1,14 @@ +// Flags: --expose-internals +'use strict'; +require('../common'); + +const assert = require('assert'); +const stripShebang = require('internal/module').stripShebang; + +[ + ['', ''], + ['aa', 'aa'], + ['#!', ''], + ['#!bin/bash', ''], + ['#!bin/bash\naa', '\naa'], +].forEach((i) => assert.strictEqual(stripShebang(i[0]), i[1]));