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

broccoli-funnel

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-funnel - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

4

index.js

@@ -136,5 +136,3 @@ 'use strict';

Funnel.prototype.cleanup = function() {
if (fs.existsSync(this._tmpDir)) {
return rimraf(this._tmpDir);
}
return rimraf(this._tmpDir);
};

@@ -141,0 +139,0 @@

{
"name": "broccoli-funnel",
"version": "0.2.1",
"version": "0.2.2",
"description": "Broccoli plugin that allows you to filter files selected from an input tree down based on regular expressions.",

@@ -5,0 +5,0 @@ "main": "index.js",

'use strict';
var fs = require('fs');
var path = require('path');
var RSVP = require('rsvp');
var expect = require('expect.js');
var walkSync = require('walk-sync');
var broccoli = require('broccoli');
var rimraf = RSVP.denodeify(require('rimraf'));

@@ -93,2 +96,22 @@ require('mocha-jshint')();

describe('without filtering options', function() {
it('linking roots without srcDir/destDir, can rebuild without error', function() {
var inputPath = path.join(fixturePath, 'dir1');
var tree = new Funnel(inputPath);
builder = new broccoli.Builder(tree);
return builder.build()
.then(function(results) {
var outputPath = results.directory;
expect(walkSync(outputPath)).to.eql(walkSync(inputPath));
return builder.build();
})
.then(function(results) {
var outputPath = results.directory;
expect(walkSync(outputPath)).to.eql(walkSync(inputPath));
});
});
it('simply returns a copy of the input tree', function() {

@@ -119,5 +142,38 @@ var inputPath = path.join(fixturePath, 'dir1');

expect(walkSync(outputPath)).to.eql(walkSync(inputPath));
})
.then(function() {
return builder.build();
})
.then(function(results) {
var outputPath = path.join(results.directory, 'some-random');
expect(walkSync(outputPath)).to.eql(walkSync(inputPath));
});
});
it('can properly handle the output path being a broken symlink', function() {
var inputPath = path.join(fixturePath, 'dir1');
var tree = new Funnel(inputPath, {
srcDir: 'subdir1'
});
builder = new broccoli.Builder(tree);
return builder.build()
.then(function() {
return rimraf(tree._tmpDir);
})
.then(function() {
fs.symlinkSync('foo/bar/baz.js', tree._tmpDir);
})
.then(function() {
return builder.build();
})
.then(function(results) {
var restrictedInputPath = path.join(inputPath, 'subdir1');
var outputPath = results.directory;
expect(walkSync(outputPath)).to.eql(walkSync(restrictedInputPath));
});
});
it('simply returns a copy of the input tree at a nested source', function() {

@@ -136,2 +192,11 @@ var inputPath = path.join(fixturePath, 'dir1');

expect(walkSync(outputPath)).to.eql(walkSync(restrictedInputPath));
})
.then(function() {
return builder.build();
})
.then(function(results) {
var restrictedInputPath = path.join(inputPath, 'subdir1');
var outputPath = results.directory;
expect(walkSync(outputPath)).to.eql(walkSync(restrictedInputPath));
});

@@ -147,9 +212,18 @@ });

var expected = [];
builder = new broccoli.Builder(tree);
return builder.build()
.then(function(results) {
var expected = [];
var outputPath = results.directory;
expect(walkSync(outputPath)).to.eql(expected);
})
.then(function() {
return builder.build();
})
.then(function(results) {
var outputPath = results.directory;
expect(walkSync(outputPath)).to.eql(expected);
});

@@ -156,0 +230,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