diff options
Diffstat (limited to 'test/mocha')
-rw-r--r-- | test/mocha/cli.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/mocha/cli.js b/test/mocha/cli.js index 150af5a3..9fb10a16 100644 --- a/test/mocha/cli.js +++ b/test/mocha/cli.js @@ -721,6 +721,20 @@ describe("bin/uglifyjs", function() { done(); }); }); + it("Should throw syntax error (console?.log``)", function(done) { + var command = uglifyjscmd + " test/input/invalid/optional-template.js"; + exec(command, function(err, stdout, stderr) { + assert.ok(err); + assert.strictEqual(stdout, ""); + assert.strictEqual(stderr.split(/\n/).slice(0, 4).join("\n"), [ + "Parse error at test/input/invalid/optional-template.js:1,12", + "console?.log``;", + " ^", + "ERROR: Invalid template on optional chain", + ].join("\n")); + done(); + }); + }); it("Should handle literal string as source map input", function(done) { var command = [ uglifyjscmd, |