@johngw/stream
Version:
Reactive programming tools using the WHATWG Streams API.
10 lines (8 loc) • 318 B
text/typescript
import { immediatelyClosingReadableStream } from '@johngw/stream/sources/immediatelyClosingReadableStream'
test('it closes the stream immediately', async () => {
const fn = jest.fn()
await immediatelyClosingReadableStream().pipeTo(
new WritableStream({ write: fn })
)
expect(fn).not.toHaveBeenCalled()
})