From 79ba924d47ce26e2044c10aa7d2689f18f875c45 Mon Sep 17 00:00:00 2001 From: contra Date: Tue, 28 Nov 2017 14:27:43 -0700 Subject: [PATCH] Update: Remove unused tests --- package.json | 2 +- test/src.js | 95 +++++----------------------------------------------- 2 files changed, 9 insertions(+), 88 deletions(-) diff --git a/package.json b/package.json index 4b5d8a26..c1f67555 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "strip-bom-stream": "^1.0.0", "through2": "^2.0.0", "vinyl": "^0.5.0", - "vinyl-filter-since": "^2.0.0" + "vinyl-filter-since": "^2.0.2" }, "devDependencies": { "buffer-equal": "^0.0.1", diff --git a/test/src.js b/test/src.js index 608569b2..f0ff83d3 100644 --- a/test/src.js +++ b/test/src.js @@ -75,12 +75,15 @@ describe('source stream', function() { } }); - it('should not explode on invalid glob (empty array)', function(done) { - var stream = vfs.src([]); - stream.once('data', done); - stream.once('end', function(){ + it('should explode on invalid glob (empty array)', function(done) { + var stream; + try { + stream = vfs.src([]); + } catch (err) { + should.exist(err); + should.not.exist(stream); done(); - }); + } }); it('should error on file not existing', function(done) { @@ -360,88 +363,6 @@ describe('source stream', function() { stream1.pipe(stream2).pipe(bufferStream); }); - it('should pass files through (empty glob array in passthrough stream)', function(done) { - var expectedPaths = [ - path.join(__dirname, './fixtures/test.coffee'), - path.join(__dirname, './fixtures/wow/suchempty') - ]; - var expectedContents = expectedPaths.map(function(path/* more args here so can't pass function directly */) { - return fs.readFileSync(path); - }); - - var onEnd = function(){ - buffered.length.should.equal(2); - buffered.forEach(function(file) { - should.exist(file.stat); - file.isBuffer().should.equal(true); - - expectedPaths.some(function(expectedPath) { - return file.path === expectedPath; - }).should.equal(true); - - expectedContents.some(function(expectedContent) { - return bufEqual(file.contents, expectedContent); - }).should.equal(true); - }); - done(); - }; - - var stream1 = vfs.src(['./fixtures/*.coffee', './fixtures/wow/*'], {cwd: __dirname}); - var stream2 = vfs.src([], {cwd: __dirname, passthrough: true}); - - var buffered = []; - bufferStream = through.obj(dataWrap(buffered.push.bind(buffered)), onEnd); - stream1.pipe(stream2).pipe(bufferStream); - }); - - it('should pass files through (empty glob array in source stream)', function(done) { - var expectedPaths = [ - path.join(__dirname, './fixtures/test.coffee'), - path.join(__dirname, './fixtures/wow/suchempty') - ]; - var expectedContents = expectedPaths.map(function(path/* more args here so can't pass function directly */) { - return fs.readFileSync(path); - }); - - var onEnd = function(){ - buffered.length.should.equal(2); - buffered.forEach(function(file) { - should.exist(file.stat); - file.isBuffer().should.equal(true); - - expectedPaths.some(function(expectedPath) { - return file.path === expectedPath; - }).should.equal(true); - - expectedContents.some(function(expectedContent) { - return bufEqual(file.contents, expectedContent); - }).should.equal(true); - }); - done(); - }; - - var stream1 = vfs.src([], {cwd: __dirname}); - var stream2 = vfs.src(['./fixtures/*.coffee', './fixtures/wow/*'], {cwd: __dirname, passthrough: true}); - - var buffered = []; - bufferStream = through.obj(dataWrap(buffered.push.bind(buffered)), onEnd); - stream1.pipe(stream2).pipe(bufferStream); - }); - - it('should still end when passing through empty streams', function(done) { - var onEnd = function(){ - buffered.length.should.equal(0); - done(); - }; - - var stream1 = vfs.src([], {cwd: __dirname}); - var stream2 = vfs.src([], {cwd: __dirname, passthrough: true}); - - var buffered = []; - bufferStream = through.obj(dataWrap(buffered.push.bind(buffered)), onEnd); - stream1.pipe(stream2).pipe(bufferStream); - }); - it('should follow file symlinks', function(done) { var expectedPath = path.join(__dirname, './fixtures/test.coffee');