Comparing version 2.0.0 to 2.0.1
@@ -69,2 +69,8 @@ "use strict"; | ||
} | ||
} else if (self[propertyName] && !target[propertyName]) { // when fsMerger.fs.hasOwnProperty is accessed we shouldn't be hijacking it to self.hasOwnProperty | ||
return function() { | ||
return self[propertyName](...arguments); | ||
} | ||
} else if (typeof target[propertyName] !== 'function') { | ||
return target[propertyName]; | ||
} | ||
@@ -71,0 +77,0 @@ return function() { |
{ | ||
"name": "fs-merger", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Reads files from a real location", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -245,2 +245,12 @@ "use strict"; | ||
it('hasOwnProperty works', function() { | ||
debugger | ||
let content = fsMerger.fs.hasOwnProperty('existsSync'); | ||
expect(content).to.be.true; | ||
}); | ||
it('non function property works', function() { | ||
expect(fsMerger.fs.F_OK).to.be.equal(fs.F_OK); | ||
}); | ||
it('exists works', function(done) { | ||
@@ -267,5 +277,5 @@ fsMerger.fs.exists('test-1', function (content) { | ||
describe('Returns entries for', function() { | ||
let fs = new FSMerge(['fixtures/test-1', 'fixtures/test-2', 'fixtures/test-3']); | ||
let fsMerger = new FSMerge(['fixtures/test-1', 'fixtures/test-2', 'fixtures/test-3']); | ||
it('root path', function () { | ||
let fsEntries = fs.entries(); | ||
let fsEntries = fsMerger.entries(); | ||
let fileList = []; | ||
@@ -279,3 +289,3 @@ let walkList = ['a.txt', 'b.txt', 'c.txt', 'd.txt', 'test-1/', 'test-1/b.txt', 'test-sub-1/', 'test-sub-1/sub-b.txt', 'test-sub-1/sub-c.txt', 'test-sub-1/test-sub-sub-1/', 'test-sub-1/test-sub-sub-1/sub-sub-b.txt', 'test-sub-1/test-sub-sub-1/sub-sub-c.txt', 'test-sub-2/' ,'x.txt']; | ||
it('test-1', function () { | ||
let fsEntries = fs.entries('test-1'); | ||
let fsEntries = fsMerger.entries('test-1'); | ||
let fileList = []; | ||
@@ -290,3 +300,3 @@ let walkList = [ 'b.txt' ]; | ||
it('test-sub-1', function() { | ||
let fsEntries = fs.entries('test-sub-1'); | ||
let fsEntries = fsMerger.entries('test-sub-1'); | ||
let fileList = []; | ||
@@ -301,3 +311,3 @@ let walkList = [ 'sub-b.txt', 'sub-c.txt', 'test-sub-sub-1/', 'test-sub-sub-1/sub-sub-b.txt', 'test-sub-sub-1/sub-sub-c.txt' ]; | ||
it('test-sub-1/test-sub-sub-1', function() { | ||
let fsEntries = fs.entries('test-sub-1/test-sub-sub-1'); | ||
let fsEntries = fsMerger.entries('test-sub-1/test-sub-sub-1'); | ||
let fileList = []; | ||
@@ -308,3 +318,13 @@ let walkList = [ 'sub-sub-b.txt', 'sub-sub-c.txt' ]; | ||
}); | ||
expect(fileList).to.be.deep.equal(walkList); | ||
}); | ||
it('can read entries from fsMeger.fs as well', function () { | ||
fsMerger = new FSMerge(['fixtures/test-1', 'fixtures/test-2', 'fixtures/test-3']).fs; | ||
let fsEntries = fsMerger.entries(); | ||
let fileList = []; | ||
let walkList = ['a.txt', 'b.txt', 'c.txt', 'd.txt', 'test-1/', 'test-1/b.txt', 'test-sub-1/', 'test-sub-1/sub-b.txt', 'test-sub-1/sub-c.txt', 'test-sub-1/test-sub-sub-1/', 'test-sub-1/test-sub-sub-1/sub-sub-b.txt', 'test-sub-1/test-sub-sub-1/sub-sub-c.txt', 'test-sub-2/' ,'x.txt']; | ||
fsEntries.forEach(entry => { | ||
fileList.push(entry.relativePath); | ||
}); | ||
expect(fileList).to.be.deep.equal(walkList); | ||
@@ -311,0 +331,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
29304
678