aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-31 15:26:57 +0800
committerGitHub <noreply@github.com>2017-03-31 15:26:57 +0800
commit11e9bdc42746832cfa1c52ca70b0171b31a422ba (patch)
tree7c8c7f5944cbb2f29981cdf5dc48af17a098cf86 /test
parenta84564d1a8b1fda740963a577f4916d15a20138b (diff)
downloadtracifyjs-11e9bdc42746832cfa1c52ca70b0171b31a422ba.tar.gz
tracifyjs-11e9bdc42746832cfa1c52ca70b0171b31a422ba.zip
fix missing preamble when shebang is absent (#1742)
Diffstat (limited to 'test')
-rw-r--r--test/mocha/comment-filter.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/mocha/comment-filter.js b/test/mocha/comment-filter.js
index 9474e732..ec17aa8c 100644
--- a/test/mocha/comment-filter.js
+++ b/test/mocha/comment-filter.js
@@ -79,5 +79,13 @@ describe("comment filters", function() {
output: { preamble: "/* Build */" }
}).code;
assert.strictEqual(code, "#!/usr/bin/node\n/* Build */\nvar x=10;");
- })
+ });
+
+ it("Should handle preamble without shebang correctly", function() {
+ var code = UglifyJS.minify("var x = 10;", {
+ fromString: true,
+ output: { preamble: "/* Build */" }
+ }).code;
+ assert.strictEqual(code, "/* Build */\nvar x=10;");
+ });
});