MCPcopy Create free account
hub / github.com/fastify/fastify / getStream

Function getStream

test/inject.test.js:373–386  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

371
372// https://github.com/hapijs/shot/blob/master/test/index.js#L836
373function getStream () {
374 const Read = function () {
375 Stream.Readable.call(this)
376 }
377 util.inherits(Read, Stream.Readable)
378 const word = '{"hello":"world"}'
379 let i = 0
380
381 Read.prototype._read = function (size) {
382 this.push(word[i] ? word[i++] : null)
383 }
384
385 return new Read()
386}
387
388test('should error the promise if ready errors', (t, done) => {
389 t.plan(3)

Callers 1

inject.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected