diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-01-17 15:12:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-17 15:12:22 +0800 |
commit | cff3bf49142e5d99ad07e182169a73f985b7b652 (patch) | |
tree | a324727ea24c7e82937e858aa1b1d1109361e393 /test/mocha | |
parent | 79cfac77bdee04021db9f60111f55005919f7b67 (diff) | |
download | tracifyjs-cff3bf49142e5d99ad07e182169a73f985b7b652.tar.gz tracifyjs-cff3bf49142e5d99ad07e182169a73f985b7b652.zip |
configure `rename` with CLI (#2802)
Diffstat (limited to 'test/mocha')
-rw-r--r-- | test/mocha/cli.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/mocha/cli.js b/test/mocha/cli.js index 85b2e8c9..671d700e 100644 --- a/test/mocha/cli.js +++ b/test/mocha/cli.js @@ -650,4 +650,36 @@ describe("bin/uglifyjs", 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; + assert.strictEqual(stdout, "function f(a){return b(a);function b(c){return c}}\n"); + 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; + assert.strictEqual(stdout, "function f(n){return function(n){return n}(n)}\n"); + 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(); + }); + }); }); |