gulpjs / vinyl

Virtual file format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use v2.0.1 fails in contents set function

Tommassissimo opened this issue · comments

I use vinyl & event-stream & mocha to test my gulp plugin.
Everything works fine with version v1.2.0 and it fails in v2.0.1(latest version)

Here is my sample Code:

     var es = require('event-stream');
     var File = require('vinyl');
      var stream = es.readArray(['I am a body'])
      var fakeFile = new File({
        contents: stream
      });

And it throw out TypeError as following:

TypeError: Cannot read property 'objectMode' of undefined
    at new Cloneable (node_modules/cloneable-readable/index.js:13:41)
    at Cloneable (node_modules/cloneable-readable/index.js:10:12)
    at File.Object.defineProperty.set (node_modules/vinyl/index.js:183:13)
    at new File (node_modules/vinyl/index.js:33:17)
    at Context.<anonymous> (test/index.js:18:22)

event-stream is an unsupported module because they either use Streams1 or create fake streams that aren't up to spec. You probably want to use the from2 module.