aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/cli.js
diff options
context:
space:
mode:
authoralexlamsl <alexlamsl@gmail.com>2017-02-18 19:30:33 +0800
committeralexlamsl <alexlamsl@gmail.com>2017-02-21 13:29:58 +0800
commit09f9ae2de9fb2a328e088ab82ad1e49731c971fb (patch)
treeca68b24b4a09542d4800547a14b13f4b96ead90c /test/mocha/cli.js
parent7e6331bb397e1dec0a4e15233a2afca3a4e9daff (diff)
downloadtracifyjs-09f9ae2de9fb2a328e088ab82ad1e49731c971fb.tar.gz
tracifyjs-09f9ae2de9fb2a328e088ab82ad1e49731c971fb.zip
improve `--beautify bracketize`
reduce whitespaces from if-else statements fixes #1482 closes #1483
Diffstat (limited to 'test/mocha/cli.js')
-rw-r--r--test/mocha/cli.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/mocha/cli.js b/test/mocha/cli.js
index 64599c51..450df1fd 100644
--- a/test/mocha/cli.js
+++ b/test/mocha/cli.js
@@ -1,5 +1,6 @@
var assert = require("assert");
var exec = require("child_process").exec;
+var readFileSync = require("fs").readFileSync;
describe("bin/uglifyjs", function () {
var uglifyjscmd = '"' + process.argv[0] + '" bin/uglifyjs';
@@ -130,4 +131,24 @@ describe("bin/uglifyjs", function () {
done();
});
});
+ it("Should work with `--beautify`", function (done) {
+ var command = uglifyjscmd + ' test/input/issue-1482/input.js -b';
+
+ exec(command, function (err, stdout) {
+ if (err) throw err;
+
+ assert.strictEqual(stdout, readFileSync("test/input/issue-1482/default.js", "utf8"));
+ done();
+ });
+ });
+ it("Should work with `--beautify bracketize`", function (done) {
+ var command = uglifyjscmd + ' test/input/issue-1482/input.js -b bracketize';
+
+ exec(command, function (err, stdout) {
+ if (err) throw err;
+
+ assert.strictEqual(stdout, readFileSync("test/input/issue-1482/bracketize.js", "utf8"));
+ done();
+ });
+ });
});