mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
12e7471213
move stream-related code to separate `@overleaf/stream-utils` library GitOrigin-RevId: a79a873109b927b4fc0ae36f47d5c67e0df58041
16 lines
449 B
JavaScript
16 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()
|
|
})
|
|
})
|
|
})
|