diff options
Diffstat (limited to 'test/mocha/cli.js')
-rw-r--r-- | test/mocha/cli.js | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/test/mocha/cli.js b/test/mocha/cli.js index 8bfdc85a..1d847dc9 100644 --- a/test/mocha/cli.js +++ b/test/mocha/cli.js @@ -593,8 +593,8 @@ describe("bin/uglifyjs", function () { done(); }); }); - it("Should work with --mangle reserved=[]", function (done) { - var command = uglifyjscmd + ' test/input/issue-505/input.js -m reserved=[callback]'; + it("Should work with --mangle reserved=[]", function(done) { + var command = uglifyjscmd + " test/input/issue-505/input.js -m reserved=[callback]"; exec(command, function (err, stdout) { if (err) throw err; @@ -603,8 +603,8 @@ describe("bin/uglifyjs", function () { done(); }); }); - it("Should work with --mangle reserved=false", function (done) { - var command = uglifyjscmd + ' test/input/issue-505/input.js -m reserved=false'; + it("Should work with --mangle reserved=false", function(done) { + var command = uglifyjscmd + " test/input/issue-505/input.js -m reserved=false"; exec(command, function (err, stdout) { if (err) throw err; @@ -613,4 +613,22 @@ describe("bin/uglifyjs", function () { done(); }); }); + it("Should fail with --mangle-props reserved=[in]", function(done) { + var command = uglifyjscmd + " test/input/issue-505/input.js --mangle-props reserved=[in]"; + exec(command, function (err, stdout, stderr) { + assert.ok(err); + assert.strictEqual(stdout, ""); + assert.ok(/^Supported options:\n[\s\S]*?\nERROR: `reserved=\[in]` is not a supported option/.test(stderr), stderr); + done(); + }); + }); + it("Should fail with --define a-b", function(done) { + var command = uglifyjscmd + " test/input/issue-505/input.js --define a-b"; + exec(command, function (err, stdout, stderr) { + assert.ok(err); + assert.strictEqual(stdout, ""); + assert.strictEqual(stderr, "Error parsing arguments for 'define': a-b\n"); + done(); + }); + }); }); |