diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-05-28 04:09:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-28 04:09:40 +0800 |
commit | fec14379f6bae209484d75ba1db5c6b5ee37ae5a (patch) | |
tree | 3eec8fe2603d68dac2dcfd851403c514f73f5888 /test | |
parent | 79131cd64749ee834118f32c2237693072950924 (diff) | |
download | tracifyjs-fec14379f6bae209484d75ba1db5c6b5ee37ae5a.tar.gz tracifyjs-fec14379f6bae209484d75ba1db5c6b5ee37ae5a.zip |
improve CLI usability (#2016)
Report supported options upon invalid option syntax.
fixes #1883
Diffstat (limited to 'test')
-rw-r--r-- | test/mocha/cli.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/mocha/cli.js b/test/mocha/cli.js index 565b6069..4234f2fb 100644 --- a/test/mocha/cli.js +++ b/test/mocha/cli.js @@ -537,4 +537,13 @@ describe("bin/uglifyjs", function () { done(); }); }); + it("Should print supported options on invalid option syntax", function(done) { + var command = uglifyjscmd + " test/input/comments/filter.js -b ascii-only"; + exec(command, function (err, stdout, stderr) { + assert.ok(err); + assert.strictEqual(stdout, ""); + assert.ok(/^Supported options:\n\{[^}]+}\nERROR: `ascii-only` is not a supported option/.test(stderr), stderr); + done(); + }); + }); }); |