give sensible error against invalid input source map (#3044)

This commit is contained in:
Alex Lam S.L
2018-03-31 18:48:20 +09:00
committed by GitHub
parent 07f64d4050
commit 02f47e1713
2 changed files with 17 additions and 1 deletions

View File

@@ -56,6 +56,18 @@ describe("bin/uglifyjs", function () {
done();
});
});
it("Should give sensible error against invalid input source map", function(done) {
var command = uglifyjscmd + " test/mocha.js --source-map content=blah,url=inline";
exec(command, function (err, stdout, stderr) {
assert.ok(err);
assert.deepEqual(stderr.split(/\n/).slice(0, 2), [
"INFO: Using input source map: blah",
"ERROR: invalid input source map: blah",
]);
done();
});
});
it("Should append source map to output when using --source-map url=inline", function (done) {
var command = uglifyjscmd + " test/input/issue-1323/sample.js --source-map url=inline";