Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Use infiniteRandom and remove pause
Browse files Browse the repository at this point in the history
  • Loading branch information
filoozom committed Apr 20, 2021
1 parent cf8d606 commit 7379f43
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/stream-muxer/tests/close-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ const infiniteRandom = {
}
}

const oneBufferAndWait = {
[Symbol.asyncIterator]: async function * () {
yield randomBuffer()
await new Promise(() => {})
}
}

module.exports = (common) => {
describe('close', () => {
let Muxer
Expand Down Expand Up @@ -198,10 +191,9 @@ module.exports = (common) => {

const listener = new Muxer(async stream => {
// Write some data before closing
stream.sink(oneBufferAndWait)
stream.sink(infiniteRandom)

// Immediate close for write
await pause(10)
await stream.closeWrite()

const results = await pipe(stream, async (source) => {
Expand Down

0 comments on commit 7379f43

Please sign in to comment.