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};']); }); }); f78f7ea81cae7d04f6289358802f808513828'/>
path: root/tests/guix-package.sh
AgeCommit message (Expand)Author
2021-04-29diagnostics, ui: Adjust to 'read-error' and 'syntax-error' in Guile 3.0.6....Ludovic Courtès
2021-03-05profiles: 'package->manifest-entry' preserves transformations by default....Ludovic Courtès
2021-02-01guix package: Add '--export-manifest'....Ludovic Courtès
2020-10-02guix package: Re-apply package transformation when upgrading....Ludovic Courtès
2020-10-02tests: Adjust to recent changes to the 'emacs' package....Ludovic Courtès
2020-09-28tests: Simplify shell exit status negation;...Eric Bavier
2020-03-25tests: Adjust to 'show-manifest-transaction' changes....Ludovic Courtès
2019-11-29tests: Fix race condition in profile locking test....Ludovic Courtès
2019-11-22package: Allow multiple '--manifest' options....Ludovic Courtès
2019-11-08guix: package: lock profiles when processing them....Julien Lepiller
2019-09-26guix package: Add '--list-profiles'....Ludovic Courtès
2019-09-18guix package: "guix package -f FILE" ensures FILE returns a package....Ludovic Courtès
2019-05-26discovery: 'all-modules' returns modules in path order....Robert Vollmert
2019-05-13tests: Fix guix-package.sh....Maxim Cournoyer
2019-05-09ui: Make package outputs searchable....Chris Marusich
2019-02-07profiles: Raise an error for unmatched patterns....Ludovic Courtès