diff --git a/lib/helpers.js b/lib/helpers.js index 0a9b6a6..89ed413 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -158,11 +158,7 @@ function addSourceMaps(file, state, callback) { nal.mapSeries(tasks, apply, done); - function done(err) { - if (err) { - return callback(err); - } - + function done() { callback(null, file); } } @@ -232,9 +228,7 @@ function writeSourceMaps(file, destPath, callback) { var sourcemapLocation = path.relative(file.dirname, sourceMapPath); - if (!isRemoteSource(sourcemapLocation)) { - sourcemapLocation = normalizePath(sourcemapLocation); - } + sourcemapLocation = normalizePath(sourcemapLocation); comment = convert.generateMapFileComment(sourcemapLocation, commentOpts); } diff --git a/test/write.js b/test/write.js index a7cf4ad..180bca8 100644 --- a/test/write.js +++ b/test/write.js @@ -225,12 +225,10 @@ describe('write', function() { }); // TODO: need to figure out this test - it.skip('does not normalize remote paths', function(done) { + it.skip('properly handles remote paths', function(done) { var file = makeNestedFile(); - file.path = file.path.replace(/\//g, '\\\\'); - console.log(file.path); - sourcemaps.write(file, '..\\\\maps', function(err, updatedFile) { - expect(updatedFile.contents).toEqual(sourceContent + '//# sourceMappingURL=../maps/helloworld.js.map\n'); + sourcemaps.write(file, 'http://example.com', function(err, updatedFile) { + expect(updatedFile.contents).toEqual(sourceContent + '//# sourceMappingURL=http://example.com/dir1/dir2/helloworld.js.map\n'); done(err); }); });