Merge pull request #12916 from overleaf/bg-move-stream-buffer-code-to-library

move stream-related code to separate  `@overleaf/stream-utils` library

GitOrigin-RevId: a79a873109b927b4fc0ae36f47d5c67e0df58041
This commit is contained in:
Eric Mc Sween
2023-06-02 08:05:57 +00:00
committed by Copybot
parent 9e154d0857
commit 12e7471213
27 changed files with 467 additions and 279 deletions
@@ -0,0 +1,16 @@
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()
})
})
})