sourcemap-validator
Advanced tools
Comparing version 1.0.7 to 1.1.0
14
index.js
@@ -34,8 +34,10 @@ var validate | ||
assert.ok(mapping.originalColumn!=null, 'missing original column, mapping: ' + prettyMapping); | ||
assert.ok(mapping.originalLine!=null, 'missing original line, mapping: ' + prettyMapping); | ||
assert.ok(mapping.originalColumn >= 0, 'original column must be greater or equal to zero, mapping: ' + prettyMapping); | ||
assert.ok(mapping.originalLine >= 0, 'original line must be greater or equal to zero, mapping: ' + prettyMapping); | ||
assert.notEqual(mapping.source, null, 'source is missing'); | ||
// If the source is null, the original location data has been explicitly | ||
// omitted from the map to clear the mapped state of a line. | ||
if (typeof mapping.source === "string") { | ||
assert.ok(mapping.originalColumn!=null, 'missing original column, mapping: ' + prettyMapping); | ||
assert.ok(mapping.originalLine!=null, 'missing original line, mapping: ' + prettyMapping); | ||
assert.ok(mapping.originalColumn >= 0, 'original column must be greater or equal to zero, mapping: ' + prettyMapping); | ||
assert.ok(mapping.originalLine >= 0, 'original line must be greater or equal to zero, mapping: ' + prettyMapping); | ||
} | ||
}; | ||
@@ -42,0 +44,0 @@ |
@@ -21,3 +21,3 @@ { | ||
], | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"repository": { | ||
@@ -24,0 +24,0 @@ "type": "git", |
@@ -95,2 +95,11 @@ var validate = require('..') | ||
tests['Valid Babel map should not throw'] = function () { | ||
var babelDir = path.join(validDir, 'Babel') | ||
, map = fs.readFileSync(path.join(babelDir, 'router.js.map')).toString(); | ||
assert.doesNotThrow(function () { | ||
validate(null, map); | ||
}, 'Valid Minifyified inline sourcemap and inline sourceContent should not throw'); | ||
}; | ||
module.exports = tests; |
27169
1312282