aboutsummaryrefslogtreecommitdiff
path: root/test/mocha
diff options
context:
space:
mode:
authorkzc <zaxxon2011@gmail.com>2016-07-29 21:27:30 -0400
committerRichard van Velzen <rvanvelzen1@gmail.com>2016-08-14 21:46:38 +0200
commitdcdcfe4d39e8769e8d7504f167610883e250d266 (patch)
tree08b67003fbcd8689dbfcdb970a37ff4f2be2aee4 /test/mocha
parent72306b9885dffcc206b6637a9c22e54fa54a168d (diff)
downloadtracifyjs-dcdcfe4d39e8769e8d7504f167610883e250d266.tar.gz
tracifyjs-dcdcfe4d39e8769e8d7504f167610883e250d266.zip
Add input file glob support to minify()
Diffstat (limited to 'test/mocha')
-rw-r--r--test/mocha/glob.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/mocha/glob.js b/test/mocha/glob.js
new file mode 100644
index 00000000..c2fc9464
--- /dev/null
+++ b/test/mocha/glob.js
@@ -0,0 +1,28 @@
+var Uglify = require('../../');
+var assert = require("assert");
+
+describe("minify() with input file globs", function() {
+ it("minify() with one input file glob string.", function() {
+ var result = Uglify.minify("test/input/issue-1242/foo.*", {
+ compress: { collapse_vars: true }
+ });
+ assert.strictEqual(result.code, 'function foo(o){print("Foo:",2*o)}var print=console.log.bind(console);');
+ });
+ it("minify() with an array of one input file glob.", function() {
+ var result = Uglify.minify([
+ "test/input/issue-1242/b*.es5",
+ ], {
+ compress: { collapse_vars: true }
+ });
+ assert.strictEqual(result.code, 'function bar(n){return 3*n}function baz(n){return n/2}');
+ });
+ it("minify() with an array of multiple input file globs.", function() {
+ var result = Uglify.minify([
+ "test/input/issue-1242/???.es5",
+ "test/input/issue-1242/*.js",
+ ], {
+ compress: { collapse_vars: true }
+ });
+ assert.strictEqual(result.code, 'function bar(n){return 3*n}function baz(n){return n/2}function foo(n){print("Foo:",2*n)}var print=console.log.bind(console);print("qux",bar(3),baz(12)),foo(11);');
+ });
+});