aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/minify-file-map.js
blob: cffb2c623990dfdcb0d796ad9a6e0f654cd978f3 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
var assert = require("assert");
var UglifyJS = require("../..");

describe("Input file as map", function() {
    it("Should accept object", function() {
        var jsMap = {
            '/scripts/foo.js': 'var foo = {"x": 1, y: 2, \'z\': 3};'
        };
        var result = UglifyJS.minify(jsMap, {sourceMap: true});

        var map = JSON.parse(result.map);
        assert.strictEqual(result.code, 'var foo={x:1,y:2,z:3};');
        assert.deepEqual(map.sources, ['/scripts/foo.js']);
        assert.strictEqual(map.file, undefined);

        result = UglifyJS.minify(jsMap);
        assert.strictEqual(result.map, undefined);

        result = UglifyJS.minify(jsMap, {sourceMap: {filename: 'out.js'}});
        map = JSON.parse(result.map);
        assert.strictEqual(map.file, 'out.js');
    });

    it("Should accept array of strings", function() {
        var jsSeq = [
            'var foo = {"x": 1, y: 2, \'z\': 3};',
            'var bar = 15;'
        ];
        var result = UglifyJS.minify(jsSeq, {sourceMap: true});

        var map = JSON.parse(result.map);
        assert.strictEqual(result.code, 'var foo={x:1,y:2,z:3},bar=15;');
        assert.deepEqual(map.sources, ['0', '1']);
    });

    it("Should correctly include source", function() {
        var jsMap = {
            '/scripts/foo.js': 'var foo = {"x": 1, y: 2, \'z\': 3};'
        };
        var result = UglifyJS.minify(jsMap, {sourceMap: {includeSources: true}});

        var map = JSON.parse(result.map);
        assert.strictEqual(result.code, 'var foo={x:1,y:2,z:3};');
        assert.deepEqual(map.sourcesContent, ['var foo = {"x": 1, y: 2, \'z\': 3};']);
    });
});
]: Remove PYTHON-SPHINX. Marius Bakke 2020-03-16gnu: python-flask-wtf: Update to 0.14.3....* gnu/packages/python-web.scm (python-flask-wtf): Update to 0.14.3. [arguments]: Remove obsolete phase. Override check phase. [native-inputs]: Remove PYTHON-NOSE. Add PYTHON-PYTEST. Marius Bakke 2020-03-16gnu: python-flask-babel: Update to 1.0.0....* gnu/packages/python-web.scm (python-flask-babel): Update to 1.0.0. [arguments]: New field. Marius Bakke 2020-03-16gnu: python-flask-login: Update to 0.5.0....* gnu/packages/python-web.scm (python-flask-login): Update to 0.5.0. [arguments]: Remove. [native-inputs]: Remove PYTHON-NOSE and PYTHON-PEP8. Add PYTHON-COVERAGE, PYTHON-PYCODESTYLE. and PYTHON-PYTEST. Marius Bakke 2020-03-16gnu: python-flask: Update to 1.1.1....* gnu/packages/python-web.scm (python-flask): Update to 1.1.1. Marius Bakke 2020-03-16gnu: python-werkzeug: Update to 1.0.0....* gnu/packages/python-web.scm (python-werkzeug): Update to 1.0.0. [source](uri): Capitalize PyPI project name. [native-inputs]: Add PYTHON-PYTEST-TIMEOUT. Marius Bakke 2020-03-11gnu: python-cookies: Use the correct version of pytest....* gnu/packages/python-web.scm (python-cookies)[native-inputs]: Change PYTHON2-PYTEST to PYTHON-PYTEST. Marius Bakke 2020-03-06gnu: python-aiohttp: Update to 3.6.2....* gnu/packages/python-web.scm (python-aiohttp): Update to 3.6.2. Ricardo Wurmus 2020-03-04gnu: Update pypi.python.org home pages & use HTTPS....* gnu/packages/check.scm (python-unittest2, python-pytest-localserver) (python-discover)[home-page]: Follow (HTTPS) redirections. * gnu/packages/fontutils.scm (python2-defcon)[home-page]: Likewise. * gnu/packages/glib.scm (python2-pygobject-2)[home-page]: Likewise. * gnu/packages/graph.scm (python-igraph)[home-page]: Likewise. * gnu/packages/graphviz.scm (xdot)[home-page]: Likewise. * gnu/packages/pdf.scm (python-poppler-qt5)[home-page]: Likewise. * gnu/packages/python-web.scm (python-zope-event, python-zope-testing) (python-zope-testrunner, python-zope-i18nmessageid, python-zope-schema) (python-zope-configuration, python-zope-proxy, python-zope-location) (python-zope-security))[home-page]: Likewise. * gnu/packages/python-xyz.scm (python-setuptools,python-six) (python2-dogtail, python2-enum, python-enum34, python-unidecode) (python-numpydoc, python-decorator, python-drmaa, python-pathlib2) (python-ly, python-msgpack, python-termcolor, python-colorama) (python-pluggy, python2-pathlib2, python-rfc3987)[home-page]: Likewise. Tobias Geerinckx-Rice 2020-03-04gnu: python-zope-exceptions: Update home page....* gnu/packages/python-web.scm (python-zope-exceptions)[home-page]: Follow (HTTPS) redirection. Tobias Geerinckx-Rice 2020-03-03gnu: python-flask-principal: Update home page....* gnu/packages/python-web.scm (python-flask-principal)[home-page]: Follow (HTTPS) redirection. Tobias Geerinckx-Rice 2020-02-26gnu: awscli: Update to 1.18.6....* gnu/packages/python-web.scm (awscli): Update to 1.18.6. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Evan Straw 2020-02-04gnu: Add grip....* gnu/packages/python-web.scm (grip): New variable. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Jakub Kądziołka 2020-02-04gnu: Add python-path-and-address....* gnu/packages/python-web.scm (python-path-and-address): New variable. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Jakub Kądziołka 2020-01-26gnu: Add python-gitlab....* gnu/packages/python-web.scm (python-gitlab): New variable. Julien Lepiller 2020-01-26gnu: Add python-translation-finder....* gnu/packages/python-web.scm (python-translation-finder): New variable. Julien Lepiller 2020-01-25gnu: httpie: Update to 2.0.0....* gnu/packages/python-web.scm (httpie): Update to 2.0.0. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josh Holland 2020-01-20gnu: Update pythonpaste.org home pages....* gnu/packages/check.scm (python-scripttest)[home-page]: Update URI. * gnu/packages/python-web.scm (python-paste, python-pastescript) (python-webtest, python-pastedeploy)[home-page]: Likewise. Tobias Geerinckx-Rice 2020-01-17gnu: gunicorn: Use HTTPS home page....* gnu/packages/python-web.scm (gunicorn)[home-page]: Use HTTPS. Tobias Geerinckx-Rice 2020-01-17gnu: python-publicsuffix2: Update to 2.20191221....* gnu/packages/python-web.scm (python-publicsuffix2): Update to 2.20191221. [arguments]: Add ‘ignore-maintainer-inputs’ phase. Tobias Geerinckx-Rice