@@ -168,65 +168,5 @@ describe('streaming utilities', () => {
168168 deepStrictEqual ( result1 , [ 1 , 2 ] ) ;
169169 deepStrictEqual ( result2 , [ 3 , 4 ] ) ;
170170 } ) ;
171-
172- it ( 'should report has() correctly' , async ( ) => {
173- const cache = createStreamingCache ( ) ;
174-
175- strictEqual ( cache . has ( 'test' ) , false ) ;
176-
177- async function * gen ( ) {
178- yield [ 1 ] ;
179- }
180-
181- cache . getOrCollect ( 'test' , gen ( ) ) ;
182-
183- strictEqual ( cache . has ( 'test' ) , true ) ;
184- strictEqual ( cache . has ( 'other' ) , false ) ;
185- } ) ;
186-
187- it ( 'should clear all entries' , async ( ) => {
188- const cache = createStreamingCache ( ) ;
189-
190- async function * gen1 ( ) {
191- yield [ 1 ] ;
192- }
193-
194- async function * gen2 ( ) {
195- yield [ 2 ] ;
196- }
197-
198- cache . getOrCollect ( 'key1' , gen1 ( ) ) ;
199- cache . getOrCollect ( 'key2' , gen2 ( ) ) ;
200-
201- strictEqual ( cache . has ( 'key1' ) , true ) ;
202- strictEqual ( cache . has ( 'key2' ) , true ) ;
203-
204- cache . clear ( ) ;
205-
206- strictEqual ( cache . has ( 'key1' ) , false ) ;
207- strictEqual ( cache . has ( 'key2' ) , false ) ;
208- } ) ;
209-
210- it ( 'should allow re-adding after clear' , async ( ) => {
211- const cache = createStreamingCache ( ) ;
212-
213- async function * gen1 ( ) {
214- yield [ 1 , 2 ] ;
215- }
216-
217- const result1 = await cache . getOrCollect ( 'test' , gen1 ( ) ) ;
218-
219- deepStrictEqual ( result1 , [ 1 , 2 ] ) ;
220-
221- cache . clear ( ) ;
222-
223- async function * gen2 ( ) {
224- yield [ 3 , 4 ] ;
225- }
226-
227- const result2 = await cache . getOrCollect ( 'test' , gen2 ( ) ) ;
228-
229- deepStrictEqual ( result2 , [ 3 , 4 ] ) ;
230- } ) ;
231171 } ) ;
232172} ) ;
0 commit comments