aboutsummaryrefslogtreecommitdiff
path: root/test/mocha
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-01-17 15:12:22 +0800
committerGitHub <noreply@github.com>2018-01-17 15:12:22 +0800
commitcff3bf49142e5d99ad07e182169a73f985b7b652 (patch)
treea324727ea24c7e82937e858aa1b1d1109361e393 /test/mocha
parent79cfac77bdee04021db9f60111f55005919f7b67 (diff)
downloadtracifyjs-cff3bf49142e5d99ad07e182169a73f985b7b652.tar.gz
tracifyjs-cff3bf49142e5d99ad07e182169a73f985b7b652.zip
configure `rename` with CLI (#2802)
Diffstat (limited to 'test/mocha')
-rw-r--r--test/mocha/cli.js32
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();
+ });
+ });
});