css-coverage
Advanced tools
Comparing version 2.0.2 to 2.0.3
{ | ||
"name": "css-coverage", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"scripts": { | ||
"pretest": "sass --source-map ./test/test.scss ./test/test.css", | ||
"test": "./bin/css-coverage.js --html ./test/test.html --css ./test/test.css --lcov ./test/test.lcov --ignore-declarations 'move-to,move-foobar'", | ||
"test-debug": "node --inspect-brk ./bin/css-coverage.js --cover-declarations --html ./test/test.html --css ./test/test.css --lcov ./test/test.lcov --ignore-declarations 'move-to,move-foobar'", | ||
"test": "./bin/css-coverage.js --html ./test/test.html --css ./test/test.css --lcov ./test/test.lcov --ignore-declarations 'move-to,move-foobar'", | ||
"test:debug": "node --inspect-brk ./bin/css-coverage.js --html ./test/test.html --css ./test/test.css --lcov ./test/test.lcov --ignore-declarations 'move-to,move-foobar'", | ||
"posttest": "standard --fix" | ||
@@ -9,0 +9,0 @@ }, |
@@ -38,15 +38,12 @@ # CSS Coverage! | ||
Generate coverage info for a CSS file against an HTML file. | ||
This supports loading sourcemaps by using the sourceMappingURL=FILENAME.map CSS comment | ||
Generate coverage info for a CSS file against an HTML file. This supports loading sourcemaps by using the sourceMappingURL=FILENAME.map CSS comment | ||
Options: | ||
-h, --help output usage information | ||
--html [path/to/file.html] path to a local HTML file | ||
--css [path/to/file.css] path to a local CSS file | ||
--lcov [path/to/output.lcov] the LCOV output file | ||
--verbose verbose/debugging output | ||
--ignore-source-map disable loading the sourcemap if one is found | ||
--cover-declarations try to cover CSS declarations as well as selectors | ||
(best-effort, difficult with sourcemaps) | ||
--html [path/to/file.html] path to a local HTML file | ||
--css [path/to/file.css] path to a local CSS file | ||
--lcov [path/to/output.lcov] the LCOV output file | ||
--verbose verbose/debugging output | ||
--ignore-source-map disable loading the sourcemap if one is found | ||
--ignore-declarations [move-to,content] A comma-separated list of declarations to ignore | ||
-h, --help output usage information | ||
``` |
@@ -278,6 +278,10 @@ const fs = require('fs') | ||
function getStartInfo (origStart, origEnd) { | ||
const startInfo = sourceMapConsumer.originalPositionFor({ line: origStart.line, column: origStart.column - 1 }) | ||
let startInfo = sourceMapConsumer.originalPositionFor({ line: origStart.line, column: origStart.column - 1 }) | ||
// const endInfo = sourceMapConsumer.originalPositionFor({line: origEnd.line, column: origEnd.column - 2}) | ||
// When there is no match, startInfo.source is null | ||
// When there is no match, startInfo.source is null. | ||
// Try fiddling with the column | ||
if (!startInfo.source) { | ||
startInfo = sourceMapConsumer.originalPositionFor({ line: origStart.line, column: origStart.column }) | ||
} | ||
if (!startInfo.source /* || startInfo.source !== endInfo.source */) { | ||
@@ -284,0 +288,0 @@ console.error('cssStart', JSON.stringify(origStart)) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117673
401
49