Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

istanbul

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

istanbul - npm Package Compare versions

Comparing version 0.3.6 to 0.3.7

6

CHANGELOG.md

@@ -6,2 +6,8 @@ Changelog

<tr>
<td>v0.3.7</td>
<td>
Fix asset paths on windows, thanks to @juangabreil
</td>
</tr>
<tr>
<td>v0.3.6</td>

@@ -8,0 +14,0 @@ <td>

13

lib/command/common/run-with-cover.js

@@ -37,3 +37,4 @@ /*

formatOption('--[no-]preserve-comments', 'remove / preserve comments in the output, defaults to false'),
formatOption('--include-all-sources', 'instrument all unused sources after running tests, defaults to false')
formatOption('--include-all-sources', 'instrument all unused sources after running tests, defaults to false'),
formatOption('--[no-]include-pid', 'include PID in output coverage filename')
].join('\n\n') + '\n');

@@ -60,3 +61,4 @@ console.error('\n');

'include-all-sources': Boolean,
'preload-sources': Boolean
'preload-sources': Boolean,
'include-pid': Boolean
},

@@ -71,3 +73,4 @@ opts = nopt(template, { v : '--verbose' }, args, 0),

'include-all-sources': opts['include-all-sources'],
'preload-sources': opts['preload-sources']
'preload-sources': opts['preload-sources'],
'include-pid': opts['include-pid']
},

@@ -89,2 +92,3 @@ reporting: {

preserveComments = opts['preserve-comments'],
includePid = opts['include-pid'],
cmd,

@@ -202,3 +206,4 @@ cmdArgs,

process.once('exit', function () {
var file = path.resolve(reportingDir, 'coverage.json'),
var pidExt = includePid ? ('-' + process.pid) : '',
file = path.resolve(reportingDir, 'coverage' + pidExt + '.json'),
collector,

@@ -205,0 +210,0 @@ cov;

@@ -27,3 +27,4 @@ /*

'baseline-file': './coverage/coverage-baseline.json',
'include-all-sources': false
'include-all-sources': false,
'include-pid': false
},

@@ -178,2 +179,7 @@ reporting: {

*/
/**
* returns if the coverage filename should include the PID. Used by the `instrument` command.
* @method includePid
* @return {Boolean} true to include pid in coverage filename.
*/

@@ -185,3 +191,3 @@

'saveBaseline', 'baselineFile',
'includeAllSources');
'includeAllSources', 'includePid');

@@ -188,0 +194,0 @@ /**

@@ -309,2 +309,6 @@ /*

function cleanPath(name){
return (SEP !== '/') ? name.split(SEP).join('/') : name;
}
/**

@@ -359,7 +363,7 @@ * a `Report` implementation that produces HTML coverage reports.

linkPath.push('<a href="' + linkMapper.ancestor(node, i + 1) + '">' +
(nodePath[i].relativeName || 'All files') + '</a>');
(cleanPath(nodePath[i].relativeName) || 'All files') + '</a>');
}
linkPath.reverse();
return linkPath.length > 0 ? linkPath.join(' &#187; ') + ' &#187; ' +
node.displayShortName() : '';
cleanPath(node.displayShortName()) : '';
},

@@ -446,3 +450,3 @@

reportClasses: reportClasses,
file: child.displayShortName(),
file: cleanPath(child.displayShortName()),
output: linkMapper.fromParent(child)

@@ -480,16 +484,4 @@ };

fromParent: function (node) {
var i = 0,
relativeName = node.relativeName,
ch;
if (SEP !== '/') {
relativeName = '';
for (i = 0; i < node.relativeName.length; i += 1) {
ch = node.relativeName.charAt(i);
if (ch === SEP) {
relativeName += '/';
} else {
relativeName += ch;
}
}
}
var relativeName = cleanPath(node.relativeName);
return node.kind === 'dir' ? relativeName + 'index.html' : relativeName + '.html';

@@ -499,2 +491,5 @@ },

var href = '',
notDot = function(part) {
return part !== '.';
},
separated,

@@ -504,4 +499,5 @@ levels,

j;
for (i = 0; i < num; i += 1) {
separated = node.relativeName.split(SEP);
separated = cleanPath(node.relativeName).split('/').filter(notDot);
levels = separated.length - 1;

@@ -508,0 +504,0 @@ for (j = 0; j < levels; j += 1) {

{
"name": "istanbul",
"version": "0.3.6",
"version": "0.3.7",
"description": "Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale",

@@ -50,3 +50,4 @@ "keywords": [ "coverage", "code coverage", "JS code coverage", "JS coverage" ],

"Rob McGuire-Dale @robatron <rob.mcguiredale@gmail.com>",
"Justin Johnson @booleangate"
"Justin Johnson @booleangate",
"Juan Gabriel Jiménez @juangabreil <juangabreil@gmail.com>"
],

@@ -87,5 +88,6 @@ "scripts": {

"requirejs": "2.x",
"coveralls": "2.x"
"coveralls": "2.x",
"glob": "4.4.x"
}
}

@@ -186,2 +186,36 @@ ## Istanbul - a JS code coverage tool written in JS

### Multiple Process Usage
Istanbul can be used in a multiple process environment by running each process
with Istanbul, writing a unique coverage file for each process, and combining
the results when generating reports. The method used to perform this will
depend on the process forking API used. For example when using the
[cluster module](http://nodejs.org/api/cluster.html) you must setup the master
to start child processes with Istanbul coverage, disable reporting, and output
coverage files that include the PID in the filename. Before each run you may
need to clear out the coverage data directory.
```javascript
if(cluster.isMaster) {
// setup cluster if running with istanbul coverage
if(process.env.running_under_istanbul) {
// use coverage for forked process
// disabled reporting and output for child process
// enable pid in child process coverage filename
cluster.setupMaster({
exec: './node_modules/.bin/istanbul',
args: [
'cover', '--report', 'none', '--print', 'none', '--include-pid',
process.argv[1], '--'].concat(process.argv.slice(2))
});
}
// ...
// ... cluster.fork();
// ...
} else {
// ... worker code
}
```
### License

@@ -188,0 +222,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc