aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/cli.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/mocha/cli.js')
-rw-r--r--test/mocha/cli.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/mocha/cli.js b/test/mocha/cli.js
index cac920d3..8c7964ac 100644
--- a/test/mocha/cli.js
+++ b/test/mocha/cli.js
@@ -509,4 +509,15 @@ describe("bin/uglifyjs", function () {
return JSON.stringify(map).replace(/"/g, '\\"');
}
});
+ it("Should dump AST as JSON", function(done) {
+ var command = uglifyjscmd + " test/input/global_defs/simple.js -mco ast";
+ exec(command, function (err, stdout) {
+ if (err) throw err;
+
+ var ast = JSON.parse(stdout);
+ assert.strictEqual(ast._class, "AST_Toplevel");
+ assert.ok(Array.isArray(ast.body));
+ done();
+ });
+ });
});