@@ -49,16 +49,16 @@ describe('Queue', () => {
4949 } ) ;
5050
5151 it ( 'should allow the executor to indicate completion' , async ( ) => {
52- const queue = new Queue < number > ( async ( _push , stop ) => {
53- await resolveOnNextTick ( ) ;
52+ const queue = new Queue < number > ( ( push , stop ) => {
5453 stop ( ) ;
54+ push ( 1 ) ; // should be ignored
5555 } ) ;
5656
5757 const sub = queue . subscribe ( ( batch ) => batch ) ;
5858 expect ( await sub . next ( ) ) . to . deep . equal ( { done : true , value : undefined } ) ;
5959 } ) ;
6060
61- it ( 'should allow a consumer to abort a pending call to nextBatch ' , async ( ) => {
61+ it ( 'should allow a consumer to abort a pending call to next ' , async ( ) => {
6262 const queue = new Queue < number > ( async ( ) => {
6363 const { promise } = promiseWithResolvers ( ) ;
6464 // wait forever
@@ -87,25 +87,6 @@ describe('Queue', () => {
8787 expect ( await sub . next ( ) ) . to . deep . equal ( { done : false , value : [ 1 , 2 , 3 ] } ) ;
8888 } ) ;
8989
90- it ( 'should stop on sync error in the executor' , async ( ) => {
91- const queue = new Queue < number > ( ( ) => {
92- throw new Error ( 'Oops' ) ;
93- } ) ;
94-
95- const sub = queue . subscribe ( ( batch ) => Array . from ( batch ) ) ;
96- expect ( await sub . next ( ) ) . to . deep . equal ( { done : true , value : undefined } ) ;
97- } ) ;
98-
99- it ( 'should stop on async errors in the executor' , async ( ) => {
100- const queue = new Queue < number > ( async ( ) => {
101- await resolveOnNextTick ( ) ;
102- throw new Error ( 'Oops' ) ;
103- } ) ;
104-
105- const sub = queue . subscribe ( ( batch ) => Array . from ( batch ) ) ;
106- expect ( await sub . next ( ) ) . to . deep . equal ( { done : true , value : undefined } ) ;
107- } ) ;
108-
10990 it ( 'should skip payloads when mapped to undefined, skipping first async payload' , async ( ) => {
11091 const queue = new Queue < number > ( async ( push ) => {
11192 await resolveOnNextTick ( ) ;
0 commit comments