From cecff8a8b5b864162fff6aa7447a32bc30e4379b Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Wed, 17 Jan 2018 13:37:39 +0800 Subject: [PATCH] add test --- test/mocha/cli.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/mocha/cli.js b/test/mocha/cli.js index 7a52185a..671d700e 100644 --- a/test/mocha/cli.js +++ b/test/mocha/cli.js @@ -650,7 +650,7 @@ describe("bin/uglifyjs", function () { done(); }); }); - it("Should work with --rename", function(done) { + it("Should work with explicit --rename", function(done) { var command = uglifyjscmd + " test/input/rename/input.js --rename"; exec(command, function(err, stdout, stderr) { if (err) throw err; @@ -658,7 +658,7 @@ describe("bin/uglifyjs", function () { done(); }); }); - it("Should work with --no-rename", function(done) { + it("Should work with explicit --no-rename", function(done) { var command = uglifyjscmd + " test/input/rename/input.js -mc --no-rename"; exec(command, function(err, stdout, stderr) { if (err) throw err; @@ -666,4 +666,20 @@ describe("bin/uglifyjs", function () { done(); }); }); + it("Should work with implicit --rename", function(done) { + var command = uglifyjscmd + " test/input/rename/input.js -mc"; + exec(command, function(err, stdout, stderr) { + if (err) throw err; + assert.strictEqual(stdout, "function f(n){return n}\n"); + done(); + }); + }); + it("Should work with implicit --no-rename", function(done) { + var command = uglifyjscmd + " test/input/rename/input.js -c"; + exec(command, function(err, stdout, stderr) { + if (err) throw err; + assert.strictEqual(stdout, "function f(x){return function(x){return x}(x)}\n"); + done(); + }); + }); });