Comparing version 1.2.2 to 1.2.3
{ | ||
"name": "blanket", | ||
"description": "seamless js code coverage", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"homepage": "https://github.com/alex-seville/blanket", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -5,2 +5,7 @@ # Blanket.js | ||
**FYI: Please note that this repo is not actively maintained** | ||
**If you're looking for a more active project for JavaScript code coverage, I recommend [Istanbul](https://github.com/gotwarlost/istanbul).** | ||
[Project home page](http://blanketjs.org/) | ||
@@ -25,3 +30,2 @@ [Blanket_js on Twitter](http://www.twitter.com/blanket_js) for updates and news. | ||
* [Contributors](#contributors) | ||
* [Roadmap](#roadmap) | ||
* [Revision History](#revision-history) | ||
@@ -122,9 +126,8 @@ | ||
## Roadmap | ||
v1.1.5 - Refactor reporter API. | ||
## Revision History | ||
Feb 18-15 - 1.2.2 | ||
PR's merged, but this project is not actively maintained. | ||
## Revision History | ||
May 1-13 - 1.1.4 | ||
@@ -131,0 +134,0 @@ Loaded reverting for grunt-blanket, branch tracking reporter fixed, coverage on-the-go (displaying coverage results while a single page is being used). |
@@ -41,9 +41,15 @@ (function(_blanket){ | ||
var toArray = Array.prototype.slice; | ||
var scripts = toArray.call(document.scripts); | ||
var selectedScripts=[],scriptNames=[]; | ||
var filter = _blanket.options("filter"); | ||
function selectAllScripts() { | ||
var browserScripts = toArray.call(document.scripts); | ||
var blanketScripts = toArray.call(document.getElementsByTagName('blanket')); | ||
return browserScripts.concat(blanketScripts); | ||
} | ||
if(filter != null){ | ||
//global filter in place, data-cover-only | ||
var antimatch = _blanket.options("antifilter"); | ||
selectedScripts = toArray.call(document.scripts) | ||
selectedScripts = selectAllScripts() | ||
.filter(function(s){ | ||
@@ -56,3 +62,3 @@ return toArray.call(s.attributes).filter(function(sn){ | ||
}else{ | ||
selectedScripts = toArray.call(document.querySelectorAll("script[data-cover]")); | ||
selectedScripts = toArray.call(document.querySelectorAll("script[data-cover], blanket")); | ||
} | ||
@@ -59,0 +65,0 @@ scriptNames = selectedScripts.map(function(s){ |
@@ -38,6 +38,6 @@ (function(){ | ||
} | ||
if (es.nodeName === "data-cover-testReadyCallback"){ | ||
if (es.nodeName.toLowerCase() === "data-cover-testreadycallback"){ | ||
newOptions.testReadyCallback = es.nodeValue; | ||
} | ||
if (es.nodeName === "data-cover-customVariable"){ | ||
if (es.nodeName.toLowerCase() === "data-cover-customvariable"){ | ||
newOptions.customVariable = es.nodeValue; | ||
@@ -86,2 +86,2 @@ } | ||
} | ||
})(); | ||
})(); |
@@ -28,6 +28,2 @@ var extend = require("xtend"), | ||
var blanketConfigs = packageConfigs ? extend(packageConfigs,userOptions) : userOptions, | ||
pattern = blanketConfigs ? | ||
blanketConfigs.pattern : | ||
"src", | ||
blanket = require("./blanket").blanket, | ||
@@ -41,3 +37,5 @@ oldLoader = require.extensions['.js'], | ||
if (blanketConfigs){ | ||
var newOptions={}; | ||
var newOptions={ | ||
'filter': 'src' // Default filter to src | ||
}; | ||
Object.keys(blanketConfigs).forEach(function (option) { | ||
@@ -79,2 +77,5 @@ var optionValue = blanketConfigs[option]; | ||
blanket.options(newOptions); | ||
} else { | ||
// If no config is specified, default filter to src. | ||
blanket.options('filter', 'src'); | ||
} | ||
@@ -163,3 +164,3 @@ | ||
inputFile: content, | ||
inputFileName: inputFilename | ||
inputFileName: blanket.normalizeBackslashes(inputFilename) | ||
},function(instrumented){ | ||
@@ -166,0 +167,0 @@ var baseDirPath = blanket.normalizeBackslashes(path.dirname(filename))+'/.'; |
@@ -11,5 +11,5 @@ blanket.defaultReporter = function(coverage){ | ||
}), | ||
bodyContent = "<div id='blanket-main'><div class='blanket bl-title'><div class='bl-cl bl-file'><a href='http://alex-seville.github.com/blanket/' target='_blank' class='bl-logo'>Blanket.js</a> results</div><div class='bl-cl rs'>Coverage (%)</div><div class='bl-cl rs'>Covered/Total Smts.</div>"+(hasBranchTracking ? "<div class='bl-cl rs'>Covered/Total Branches</div>":"")+"<div style='clear:both;'></div></div>", | ||
fileTemplate = "<div class='blanket {{statusclass}}'><div class='bl-cl bl-file'><span class='bl-nb'>{{fileNumber}}.</span><a href='javascript:blanket_toggleSource(\"file-{{fileNumber}}\")'>{{file}}</a></div><div class='bl-cl rs'>{{percentage}} %</div><div class='bl-cl rs'>{{numberCovered}}/{{totalSmts}}</div>"+( hasBranchTracking ? "<div class='bl-cl rs'>{{passedBranches}}/{{totalBranches}}</div>" : "" )+"<div id='file-{{fileNumber}}' class='bl-source' style='display:none;'>{{source}}</div><div style='clear:both;'></div></div>"; | ||
grandTotalTemplate = "<div class='blanket grand-total {{statusclass}}'><div class='bl-cl'>{{rowTitle}}</div><div class='bl-cl rs'>{{percentage}} %</div><div class='bl-cl rs'>{{numberCovered}}/{{totalSmts}}</div>"+( hasBranchTracking ? "<div class='bl-cl rs'>{{passedBranches}}/{{totalBranches}}</div>" : "" ) + "<div style='clear:both;'></div></div>"; | ||
bodyContent = "<table id='blanket-main'><tr><th class='blanket bl-title'><th class='bl-cl bl-file'><a href='http://alex-seville.github.com/blanket/' target='_blank' class='bl-logo'>Blanket.js</a> results</th><th class='bl-cl rs'>Coverage (%)</th><th class='bl-cl rs'>Covered/Total Smts.</th>"+(hasBranchTracking ? "<th class='bl-cl rs'>Covered/Total Branches</th>":"")+"<th style='clear:both;'></th></tr></table>", | ||
fileTemplate = "<tr><td class='blanket {{statusclass}}'><td class='bl-cl bl-file'><span class='bl-nb'>{{fileNumber}}.</span><a href='javascript:blanket_toggleSource(\"file-{{fileNumber}}\")'>{{file}}</a></td><td class='bl-cl rs'>{{percentage}} %</td><td class='bl-cl rs'>{{numberCovered}}/{{totalSmts}}</td>"+( hasBranchTracking ? "<td class='bl-cl rs'>{{passedBranches}}/{{totalBranches}}</td>" : "" )+"<td id='file-{{fileNumber}}' class='bl-source' style='display:none;'>{{source}}</td><td style='clear:both;'></td></td></tr>"; | ||
grandTotalTemplate = "<tr><td class='blanket grand-total {{statusclass}}'><td class='bl-cl'>{{rowTitle}}</td><td class='bl-cl rs'>{{percentage}} %</td><td class='bl-cl rs'>{{numberCovered}}/{{totalSmts}}</td>"+( hasBranchTracking ? "<td class='bl-cl rs'>{{passedBranches}}/{{totalBranches}}</td>" : "" ) + "<td style='clear:both;'></td></td></tr>"; | ||
@@ -48,4 +48,3 @@ function blanket_toggleSource(id) { | ||
.replace(/`/g, "`") | ||
.replace(/[$]/g, "$") | ||
.replace(/&/g, "&"); | ||
.replace(/[$]/g, "$"); | ||
} | ||
@@ -101,3 +100,3 @@ | ||
//consequent | ||
var cons = thisline.consequent; | ||
@@ -111,3 +110,3 @@ if (cons.start.line > lineNum){ | ||
newsrc += escapeInvalidXmlChars(src.slice(0,cons.start.column-offset)) + style; | ||
if (cols.length > colsIndex+1 && | ||
@@ -188,8 +187,8 @@ cols[colsIndex+1].consequent.start.line === lineNum && | ||
i; | ||
var end = []; | ||
for(i = 0; i < statsForFile.source.length; i +=1){ | ||
var src = statsForFile.source[i]; | ||
if (branchStack.length > 0 || | ||
@@ -202,6 +201,6 @@ typeof statsForFile.branchData !== 'undefined') | ||
var colsIndex=0; | ||
src = branchReport(colsIndex,src,cols,0,i+1).src; | ||
}else if (branchStack.length){ | ||
@@ -252,3 +251,3 @@ src = branchReport(0,src,null,0,i+1).src; | ||
// if "data-cover-modulepattern" was provided, | ||
// if "data-cover-modulepattern" was provided, | ||
// track totals per module name as well as globally | ||
@@ -294,3 +293,3 @@ if (modulePatternRegex) { | ||
// create temporary function for use by the global totals reporter, | ||
// create temporary function for use by the global totals reporter, | ||
// as well as the per-module totals reporter | ||
@@ -313,4 +312,4 @@ var createAggregateTotal = function(numSt, numCov, numBranch, numCovBr, moduleName) { | ||
// if "data-cover-modulepattern" was provided, | ||
// output the per-module totals alongside the global totals | ||
// if "data-cover-modulepattern" was provided, | ||
// output the per-module totals alongside the global totals | ||
if (modulePatternRegex) { | ||
@@ -317,0 +316,0 @@ for (var thisModuleName in totals.moduleTotalStatements) { |
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
1036171
35
18608
141
44