mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
12e7471213
move stream-related code to separate `@overleaf/stream-utils` library GitOrigin-RevId: a79a873109b927b4fc0ae36f47d5c67e0df58041
20 lines
668 B
JavaScript
20 lines
668 B
JavaScript
const { expect } = require('chai')
|
|
const { WritableBuffer } = require('../../index')
|
|
|
|
describe('WritableBuffer', function () {
|
|
it('should store all data written to it in a node Buffer', function () {
|
|
const bufferStream = new WritableBuffer()
|
|
bufferStream.write('hello')
|
|
bufferStream.write('world')
|
|
bufferStream.end()
|
|
expect(bufferStream.contents().toString()).to.equal('helloworld')
|
|
})
|
|
|
|
it('should return the size of the data written to it', function () {
|
|
const bufferStream = new WritableBuffer()
|
|
bufferStream.write('hello')
|
|
bufferStream.write('world')
|
|
bufferStream.end()
|
|
expect(bufferStream.size()).to.equal(10)
|
|
})
|
|
})
|