Added test for #1236
This commit is contained in:
committed by
Richard van Velzen
parent
307b88d6cc
commit
85a09fc3b6
8
test/mocha/input/issue-1236/simple.js
Normal file
8
test/mocha/input/issue-1236/simple.js
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
var foo = function foo(x) {
|
||||
return "foo " + x;
|
||||
};
|
||||
console.log(foo("bar"));
|
||||
|
||||
//# sourceMappingURL=simple.js.map
|
||||
8
test/mocha/input/issue-1236/simple.js.map
Normal file
8
test/mocha/input/issue-1236/simple.js.map
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["index.js"],
|
||||
"names": [],
|
||||
"mappings": ";;AAAA,IAAI,MAAM,SAAN,GAAM;AAAA,SAAK,SAAS,CAAd;AAAA,CAAV;AACA,QAAQ,GAAR,CAAY,IAAI,KAAJ,CAAZ",
|
||||
"file": "simple.js",
|
||||
"sourcesContent": ["let foo = x => \"foo \" + x;\nconsole.log(foo(\"bar\"));"]
|
||||
}
|
||||
@@ -59,4 +59,20 @@ describe("minify", function() {
|
||||
'a["foo"]="bar",a.a="red",x={"bar":10};');
|
||||
});
|
||||
});
|
||||
|
||||
describe("inSourceMap", function() {
|
||||
it("Should read the given string filename correctly when sourceMapIncludeSources is enabled (#1236)", function() {
|
||||
var result = Uglify.minify('./test/mocha/input/issue-1236/simple.js', {
|
||||
outSourceMap: "simple.js.min.map",
|
||||
inSourceMap: "./test/mocha/input/issue-1236/simple.js.map",
|
||||
sourceMapIncludeSources: true
|
||||
});
|
||||
|
||||
var map = JSON.parse(result.map);
|
||||
|
||||
assert.equal(map.sourcesContent.length, 1);
|
||||
assert.equal(map.sourcesContent[0],
|
||||
'let foo = x => "foo " + x;\nconsole.log(foo("bar"));');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user