mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 00:25:18 -05:00
17 lines
449 B
JavaScript
17 lines
449 B
JavaScript
|
const { expect } = require('chai')
|
||
|
const { ReadableString } = require('../../index')
|
||
|
|
||
|
describe('ReadableString', function () {
|
||
|
it('should emit the string passed to it', function (done) {
|
||
|
const stringStream = new ReadableString('hello world')
|
||
|
let data = ''
|
||
|
stringStream.on('data', chunk => {
|
||
|
data += chunk.toString()
|
||
|
})
|
||
|
stringStream.on('end', () => {
|
||
|
expect(data).to.equal('hello world')
|
||
|
done()
|
||
|
})
|
||
|
})
|
||
|
})
|