ReadableStringTests.js 449 B

12345678910111213141516
  1. const { expect } = require('chai')
  2. const { ReadableString } = require('../../index')
  3. describe('ReadableString', function () {
  4. it('should emit the string passed to it', function (done) {
  5. const stringStream = new ReadableString('hello world')
  6. let data = ''
  7. stringStream.on('data', chunk => {
  8. data += chunk.toString()
  9. })
  10. stringStream.on('end', () => {
  11. expect(data).to.equal('hello world')
  12. done()
  13. })
  14. })
  15. })