aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard van Velzen <rvanvelzen@experty.com>2016-06-20 16:57:40 +0200
committerRichard van Velzen <rvanvelzen@experty.com>2016-07-01 09:46:05 +0200
commitdebc525fa117438d4971df3790f9f476fed65858 (patch)
treec203d9c406803dbad59c4efbb69914f38df0a4f5
parent5576e2737ad95c12d0a559015ff375c785232ec6 (diff)
downloadtracifyjs-debc525fa117438d4971df3790f9f476fed65858.tar.gz
tracifyjs-debc525fa117438d4971df3790f9f476fed65858.zip
Introduce a test that tests the --self build
-rw-r--r--test/mocha/cli.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/mocha/cli.js b/test/mocha/cli.js
new file mode 100644
index 00000000..38b57cd7
--- /dev/null
+++ b/test/mocha/cli.js
@@ -0,0 +1,22 @@
+var assert = require("assert");
+var exec = require("child_process").exec;
+
+describe("bin/uglifyjs", function () {
+ it("should produce a functional build when using --self", function (done) {
+ this.timeout(5000);
+
+ var uglifyjs = '"' + process.argv[0] + '" bin/uglifyjs';
+ var command = uglifyjs + ' --self -cm --wrap WrappedUglifyJS';
+
+ exec(command, function (err, stdout) {
+ if (err) throw err;
+
+ eval(stdout);
+
+ assert.strictEqual(typeof WrappedUglifyJS, 'object');
+ assert.strictEqual(true, WrappedUglifyJS.parse('foo;') instanceof WrappedUglifyJS.AST_Node);
+
+ done();
+ });
+ });
+});