tschaub / mock-fs

Configurable mock for the fs module
https://npmjs.org/package/mock-fs
Other
911 stars 86 forks source link

item.getContent is not a function #212

Open ch-andrewrhyne opened 7 years ago

ch-andrewrhyne commented 7 years ago

image

This seems to happen if I call end on a WriteStream that was created by createWriteStream:

  import { createWriteStream } from 'graceful-fs';
  import mockFs from 'mock-fs';

  mockFs({
    '/chlogs/foobar': mockFs.directory({
      mode: 755
    })
  });

  const stream = createWriteStream('/chlogs/foobar', {
    flags: 'a'
  });

  stream.write('hello world');

  stream.end('');

I can reproduce this with both fs and graceful-fs in a mocha test