This commit is contained in:
alexlamsl 2018-01-17 13:37:39 +08:00
parent 352b92292d
commit cecff8a8b5

View File

@ -650,7 +650,7 @@ describe("bin/uglifyjs", function () {
done(); 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"; var command = uglifyjscmd + " test/input/rename/input.js --rename";
exec(command, function(err, stdout, stderr) { exec(command, function(err, stdout, stderr) {
if (err) throw err; if (err) throw err;
@ -658,7 +658,7 @@ describe("bin/uglifyjs", function () {
done(); 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"; var command = uglifyjscmd + " test/input/rename/input.js -mc --no-rename";
exec(command, function(err, stdout, stderr) { exec(command, function(err, stdout, stderr) {
if (err) throw err; if (err) throw err;
@ -666,4 +666,20 @@ describe("bin/uglifyjs", function () {
done(); 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();
});
});
}); });