From ddcbe8ec6a721e890e90144935f0f209995b18f1 Mon Sep 17 00:00:00 2001 From: chocolateboy Date: Fri, 11 Dec 2015 01:29:11 +0000 Subject: [PATCH] add test for the boolean (true) source-map option --- test/dest.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/dest.js b/test/dest.js index 1a4445ce..d094ec04 100644 --- a/test/dest.js +++ b/test/dest.js @@ -61,6 +61,31 @@ describe('dest stream', function() { } }); + it('should not explode if the sourcemap option is true', function(done) { + var inputPath = path.join(__dirname, './fixtures/test.coffee'); + + var expectedFile = new File({ + base: __dirname, + cwd: __dirname, + path: inputPath, + contents: null + }); + + var onEnd = function(){ + buffered.length.should.equal(1); + buffered[0].should.equal(expectedFile); + done(); + }; + + var stream = vfs.dest(path.join(__dirname, './out-fixtures/'), { sourcemaps: true }); + + var buffered = []; + var bufferStream = through.obj(dataWrap(buffered.push.bind(buffered)), onEnd); + stream.pipe(bufferStream); + stream.write(expectedFile); + stream.end(); + }); + it('should pass through writes with cwd', function(done) { var inputPath = path.join(__dirname, './fixtures/test.coffee');