Skip to content

Commit 357819a

Browse files
committed
chore: remove unrelated changes from test-stream-iter-broadcast-from.js
1 parent d589482 commit 357819a

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

test/parallel/test-stream-iter-broadcast-from.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,15 @@ async function testBroadcastFromMultipleConsumers() {
6666
async function testAbortSignal() {
6767
const ac = new AbortController();
6868
const { broadcast: bc } = broadcast({ signal: ac.signal });
69-
const iter = bc.push()[Symbol.asyncIterator]();
70-
const read = iter.next();
71-
const rejected = assert.rejects(read, { name: 'AbortError' });
69+
const consumer = bc.push();
7270

7371
ac.abort();
7472

75-
await rejected;
73+
const batches = [];
74+
for await (const batch of consumer) {
75+
batches.push(batch);
76+
}
77+
assert.strictEqual(batches.length, 0);
7678
}
7779

7880
async function testAlreadyAbortedSignal() {
@@ -82,12 +84,11 @@ async function testAlreadyAbortedSignal() {
8284
const { broadcast: bc } = broadcast({ signal: ac.signal });
8385
const consumer = bc.push();
8486

85-
await assert.rejects(async () => {
86-
// eslint-disable-next-line no-unused-vars
87-
for await (const _ of consumer) {
88-
assert.fail('Should not reach here');
89-
}
90-
}, { name: 'AbortError' });
87+
const batches = [];
88+
for await (const batch of consumer) {
89+
batches.push(batch);
90+
}
91+
assert.strictEqual(batches.length, 0);
9192
}
9293

9394
// =============================================================================

0 commit comments

Comments
 (0)