Unexpected-stream

Node.js stream plugin for the Unexpected assertion library (version 7+ required).

Unexpected stream

NPM version Build Status Coverage Status Dependency Status

var base64Stream = require('base64-stream');
 
return expect(
  ['Zm9vYm', 'FyCg=='],
  'when piped through',
  new base64Stream.Base64Decode(),
  'to yield output satisfying',
  Buffer.from([0x66, 0x6f, 0x6f])
);
expected [ 'Zm9vYm''FyCg==' ]
when piped through Base64Decode to yield output satisfying Buffer.from([0x66, 0x6F, 0x6F])
  
expected Base64Decode to yield output satisfying Buffer.from([0x66, 0x6F, 0x6F])
  
expected Buffer.from([0x66, 0x6F, 0x6F, 0x62, 0x61, 0x72, 0x0A])
to equal Buffer.from([0x66, 0x6F, 0x6F])
 
66 6F 6F 62 61 72 0A                             │foobar.
66 6F 6F                                         │foo
return expect(
  require('fs').createReadStream('README.md', { encoding: 'utf-8' }),
  'to yield output satisfying',
  /Node\.js stream plugin/
);

License

Unexpected-stream is licensed under a standard 3-clause BSD license -- see the LICENSE file for details.

Fork me on GitHub