aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/glob.js
blob: c2fc94642e222c8a9086409e4a95c139938afa5d (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);');
    });
});
08-30etc: Add tempel snippets....Nicolas Graves 2022-05-12snippets: Add a 'remove' snippet....Maxim Cournoyer 2022-01-19etc: Match define-public only at line start....Liliana Marie Prikler 2021-06-26etc: snippets: Use ‘hg-file-name’ when origin uses ‘hg-fetch’...Xinglu Chen