diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-05-23 20:25:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-23 20:25:48 +0800 |
commit | e667f0acb87484617f506b561ecf0497ef9bdf25 (patch) | |
tree | ac96eb5e3600febd05fcd9e83dd25a649ffb0cd7 /test/mocha/minify.js | |
parent | 69ac794bc82a5e8451a49a2a32f44a7aee895542 (diff) | |
download | tracifyjs-e667f0acb87484617f506b561ecf0497ef9bdf25.tar.gz tracifyjs-e667f0acb87484617f506b561ecf0497ef9bdf25.zip |
fix source map offset (#1993)
Account for whitespace insertions.
fixes #505
fixes #890
Diffstat (limited to 'test/mocha/minify.js')
-rw-r--r-- | test/mocha/minify.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/mocha/minify.js b/test/mocha/minify.js index 99771755..77b798ec 100644 --- a/test/mocha/minify.js +++ b/test/mocha/minify.js @@ -138,13 +138,25 @@ describe("minify", function() { }); var code = result.code; assert.strictEqual(code, "var a=function(n){return n};\n" + - "//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIjAiXSwibmFtZXMiOlsiYSIsImZvbyJdLCJtYXBwaW5ncyI6IkFBQUEsR0FBSUEsR0FBSSxTQUFTQyxHQUFPLE1BQU9BIn0="); + "//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIjAiXSwibmFtZXMiOlsiYSIsImZvbyJdLCJtYXBwaW5ncyI6IkFBQUEsSUFBSUEsRUFBSSxTQUFTQyxHQUFPLE9BQU9BIn0="); }); it("should not append source map to output js when sourceMapInline is not enabled", function() { var result = Uglify.minify('var a = function(foo) { return foo; };'); var code = result.code; assert.strictEqual(code, "var a=function(n){return n};"); }); + it("should work with max_line_len", function() { + var result = Uglify.minify(read("./test/input/issue-505/input.js"), { + output: { + max_line_len: 20 + }, + sourceMap: { + url: "inline" + } + }); + assert.strictEqual(result.error, undefined); + assert.strictEqual(result.code, read("./test/input/issue-505/output.js")); + }); }); describe("#__PURE__", function() { |