broccoli-funnel
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -47,3 +47,3 @@ 'use strict'; | ||
return a instanceof Minimatch; | ||
}).length > 0; | ||
}).length === this.include.length; | ||
@@ -50,0 +50,0 @@ this._instantiatedStack = (new Error()).stack; |
{ | ||
"name": "broccoli-funnel", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Broccoli plugin that allows you to filter files selected from an input node down based on regular expressions.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -36,7 +36,7 @@ 'use strict'; | ||
return builder.build() | ||
.then(function(results) { | ||
var outputPath = results.directory; | ||
.then(function(results) { | ||
var outputPath = results.directory; | ||
expect(walkSync(outputPath)).to.eql(walkSync(inputPath)); | ||
}); | ||
expect(walkSync(outputPath)).to.eql(walkSync(inputPath)); | ||
}); | ||
}); | ||
@@ -61,14 +61,14 @@ | ||
return builder.build() | ||
.then(function(results) { | ||
var expected = [ | ||
[ path.join('__input_path__', 'subdir1/subsubdir1/foo.png'), | ||
path.join('__output_path__', 'foo/subdir1/subsubdir1/foo.png'), | ||
'subdir1/subsubdir1/foo.png' ], | ||
.then(function(results) { | ||
var expected = [ | ||
[ path.join('__input_path__', 'subdir1/subsubdir1/foo.png'), | ||
path.join('__output_path__', 'foo/subdir1/subsubdir1/foo.png'), | ||
'subdir1/subsubdir1/foo.png' ], | ||
[ path.join('__input_path__', 'subdir1/subsubdir2/some.js'), | ||
path.join('__output_path__', 'foo/subdir1/subsubdir2/some.js'), | ||
'subdir1/subsubdir2/some.js' ] | ||
]; | ||
]; | ||
expect(processFileArguments).to.eql(expected); | ||
}); | ||
expect(processFileArguments).to.eql(expected); | ||
}); | ||
}); | ||
@@ -89,9 +89,42 @@ | ||
return builder.build() | ||
.then(function(results) { | ||
var outputPath = results.directory; | ||
.then(function(results) { | ||
var outputPath = results.directory; | ||
expect(walkSync(outputPath)).to.eql([]); | ||
}); | ||
expect(walkSync(outputPath)).to.eql([]); | ||
}); | ||
}); | ||
it('works with mixed glob and RegExp includes', function() { | ||
var inputPath = path.join(fixturePath, 'dir1'); | ||
var node = new Funnel(inputPath, { | ||
include: [ '**/*.png', /.js$/ ], | ||
destDir: 'foo', | ||
processFile: function() { | ||
/* do nothing */ | ||
} | ||
}); | ||
builder = new broccoli.Builder(node); | ||
return builder.build() | ||
.then(function(results) { | ||
var outputPath = results.directory; | ||
expect(walkSync(outputPath)).to.eql([]); | ||
}); | ||
}); | ||
it('correctly chooses _matchedWalk scenario', function() { | ||
var inputPath = path.join(fixturePath, 'dir1'); | ||
var node; | ||
node = new Funnel(inputPath, { include: [ '**/*.png', /.js$/ ] }); | ||
expect(node._matchedWalk).to.eql(false); | ||
node = new Funnel(inputPath, { include: [ '**/*.png', '**/*.js' ] }); | ||
expect(node._matchedWalk).to.eql(true); | ||
}); | ||
}); | ||
@@ -98,0 +131,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
34511
618
0