New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

buster-istanbul

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buster-istanbul - npm Package Compare versions

Comparing version 0.1.12 to 0.1.13

32

lib/buster-istanbul.js

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

path = require('path'),
istanbul = require('istanbul');
istanbul = require('istanbul'),
minimatch = require('minimatch');

@@ -53,4 +54,17 @@ function merge(paths) {

// reusable method to check for exclusions
var isExcluded = function(path, excludes){
var excluded = false;
if (path && excludes && excludes.length) {
excluded = excludes.some(function(exclude){
return minimatch(path, exclude);
});
}
return excluded;
}
var setup = {
node: function(group, instrument) {
node: function(group, instrument, excludes) {
coverage.hookRequire();

@@ -60,3 +74,6 @@ if (instrument === false) return;

glob.sync(pattern).forEach(function(fPath) {
coverage.addInstrumentCandidate(fPath);
var excluded = isExcluded(fPath, excludes);
if (!excluded) {
coverage.addInstrumentCandidate(fPath);
}
});

@@ -66,3 +83,3 @@ });

browser: function(group, instrument) {
browser: function(group, instrument, excludes) {
var options = group.config.options;

@@ -83,3 +100,6 @@

rs.addProcessor(function(resource, content){
return coverage.instrumentCode(content, resource['path'].replace(/\//, ''));
var path = resource.path.replace(/\//, '');
var excluded = isExcluded(path, excludes);
return excluded ? content : coverage.instrumentCode(content, path);
});

@@ -126,3 +146,3 @@ });

var opts = this.options;
setup[group.environment](group, opts.instrument);
setup[group.environment](group, opts.instrument, opts.excludes);
process.on("exit", function() {

@@ -129,0 +149,0 @@ writeReports(opts.outputDirectory, opts.format || opts.formats, !!opts.silent);

5

package.json
{
"name": "buster-istanbul",
"description": "buster extension for istanbul code coverage.",
"version": "0.1.12",
"version": "0.1.13",
"homepage": "https://github.com/englishtown/buster-istanbul",

@@ -32,4 +32,5 @@ "author": {

"buster-core": "*",
"glob": "*",
"istanbul": "*",
"glob": "*"
"minimatch": "^2.0.1"
},

@@ -36,0 +37,0 @@ "devDependencies": {

@@ -34,3 +34,4 @@ # buster-istanbul

outputDirectory: "coverage",
format: "lcov"
format: "lcov",
excludes: ["**/*.json"]
},

@@ -70,2 +71,6 @@ extensions: [

`excludes` is an array of glob paths that will be excluded from instrumentation.
This can be helpful if your sources include non-js files that needed to be excluded, such as .html or .json files.
Consult [node-glob](https://github.com/isaacs/node-glob) for more information on globs.
Write your buster test as usual.

@@ -72,0 +77,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