File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,11 +70,12 @@ async function testAbortSignal() {
7070
7171 ac . abort ( ) ;
7272
73- const batches = [ ] ;
74- for await ( const batch of consumer ) {
75- batches . push ( batch ) ;
76- }
77- assert . strictEqual ( batches . length , 0 ) ;
73+ await assert . rejects ( async ( ) => {
74+ // eslint-disable-next-line no-unused-vars
75+ for await ( const _ of consumer ) {
76+ assert . fail ( 'Should not reach here' ) ;
77+ }
78+ } , { name : 'AbortError' } ) ;
7879}
7980
8081async function testAlreadyAbortedSignal ( ) {
@@ -84,11 +85,12 @@ async function testAlreadyAbortedSignal() {
8485 const { broadcast : bc } = broadcast ( { signal : ac . signal } ) ;
8586 const consumer = bc . push ( ) ;
8687
87- const batches = [ ] ;
88- for await ( const batch of consumer ) {
89- batches . push ( batch ) ;
90- }
91- assert . strictEqual ( batches . length , 0 ) ;
88+ await assert . rejects ( async ( ) => {
89+ // eslint-disable-next-line no-unused-vars
90+ for await ( const _ of consumer ) {
91+ assert . fail ( 'Should not reach here' ) ;
92+ }
93+ } , { name : 'AbortError' } ) ;
9294}
9395
9496// =============================================================================
You can’t perform that action at this time.
0 commit comments