1- import { deepStrictEqual , ok , strictEqual } from 'node:assert/strict' ;
1+ import assert from 'node:assert/strict' ;
22import { describe , it } from 'node:test' ;
33
44import {
@@ -16,7 +16,7 @@ describe('streaming utilities', () => {
1616
1717 const gen = asyncGen ( ) ;
1818
19- strictEqual ( isAsyncGenerator ( gen ) , true ) ;
19+ assert . strictEqual ( isAsyncGenerator ( gen ) , true ) ;
2020 } ) ;
2121
2222 it ( 'should return false for regular generators' , ( ) => {
@@ -26,24 +26,24 @@ describe('streaming utilities', () => {
2626
2727 const gen = syncGen ( ) ;
2828
29- strictEqual ( isAsyncGenerator ( gen ) , false ) ;
29+ assert . strictEqual ( isAsyncGenerator ( gen ) , false ) ;
3030 } ) ;
3131
3232 it ( 'should return false for plain objects' , ( ) => {
33- strictEqual ( isAsyncGenerator ( { } ) , false ) ;
34- strictEqual ( isAsyncGenerator ( [ ] ) , false ) ;
35- strictEqual ( isAsyncGenerator ( { async : true } ) , false ) ;
33+ assert . strictEqual ( isAsyncGenerator ( { } ) , false ) ;
34+ assert . strictEqual ( isAsyncGenerator ( [ ] ) , false ) ;
35+ assert . strictEqual ( isAsyncGenerator ( { async : true } ) , false ) ;
3636 } ) ;
3737
3838 it ( 'should return false for null and undefined' , ( ) => {
39- strictEqual ( isAsyncGenerator ( null ) , false ) ;
40- strictEqual ( isAsyncGenerator ( undefined ) , false ) ;
39+ assert . strictEqual ( isAsyncGenerator ( null ) , false ) ;
40+ assert . strictEqual ( isAsyncGenerator ( undefined ) , false ) ;
4141 } ) ;
4242
4343 it ( 'should return false for primitives' , ( ) => {
44- strictEqual ( isAsyncGenerator ( 42 ) , false ) ;
45- strictEqual ( isAsyncGenerator ( 'string' ) , false ) ;
46- strictEqual ( isAsyncGenerator ( true ) , false ) ;
44+ assert . strictEqual ( isAsyncGenerator ( 42 ) , false ) ;
45+ assert . strictEqual ( isAsyncGenerator ( 'string' ) , false ) ;
46+ assert . strictEqual ( isAsyncGenerator ( true ) , false ) ;
4747 } ) ;
4848
4949 it ( 'should return true for objects with Symbol.asyncIterator' , ( ) => {
@@ -55,7 +55,7 @@ describe('streaming utilities', () => {
5555 } ,
5656 } ;
5757
58- strictEqual ( isAsyncGenerator ( asyncIterable ) , true ) ;
58+ assert . strictEqual ( isAsyncGenerator ( asyncIterable ) , true ) ;
5959 } ) ;
6060 } ) ;
6161
@@ -69,7 +69,7 @@ describe('streaming utilities', () => {
6969
7070 const result = await collectAsyncGenerator ( gen ( ) ) ;
7171
72- deepStrictEqual ( result , [ 1 , 2 , 3 , 4 , 5 ] ) ;
72+ assert . deepStrictEqual ( result , [ 1 , 2 , 3 , 4 , 5 ] ) ;
7373 } ) ;
7474
7575 it ( 'should return empty array for empty generator' , async ( ) => {
@@ -79,7 +79,7 @@ describe('streaming utilities', () => {
7979
8080 const result = await collectAsyncGenerator ( gen ( ) ) ;
8181
82- deepStrictEqual ( result , [ ] ) ;
82+ assert . deepStrictEqual ( result , [ ] ) ;
8383 } ) ;
8484
8585 it ( 'should handle single chunk' , async ( ) => {
@@ -89,7 +89,7 @@ describe('streaming utilities', () => {
8989
9090 const result = await collectAsyncGenerator ( gen ( ) ) ;
9191
92- deepStrictEqual ( result , [ 1 , 2 , 3 ] ) ;
92+ assert . deepStrictEqual ( result , [ 1 , 2 , 3 ] ) ;
9393 } ) ;
9494
9595 it ( 'should handle empty chunks' , async ( ) => {
@@ -102,7 +102,7 @@ describe('streaming utilities', () => {
102102
103103 const result = await collectAsyncGenerator ( gen ( ) ) ;
104104
105- deepStrictEqual ( result , [ 1 , 2 , 3 ] ) ;
105+ assert . deepStrictEqual ( result , [ 1 , 2 , 3 ] ) ;
106106 } ) ;
107107
108108 it ( 'should handle objects in chunks' , async ( ) => {
@@ -113,16 +113,16 @@ describe('streaming utilities', () => {
113113
114114 const result = await collectAsyncGenerator ( gen ( ) ) ;
115115
116- deepStrictEqual ( result , [ { a : 1 } , { b : 2 } , { c : 3 } ] ) ;
116+ assert . deepStrictEqual ( result , [ { a : 1 } , { b : 2 } , { c : 3 } ] ) ;
117117 } ) ;
118118 } ) ;
119119
120120 describe ( 'createStreamingCache' , ( ) => {
121121 it ( 'should create a cache with required methods' , ( ) => {
122122 const cache = createStreamingCache ( ) ;
123123
124- ok ( cache ) ;
125- strictEqual ( typeof cache . getOrCollect , 'function' ) ;
124+ assert . ok ( cache ) ;
125+ assert . strictEqual ( typeof cache . getOrCollect , 'function' ) ;
126126 } ) ;
127127
128128 it ( 'should return same promise for same key' , async ( ) => {
@@ -145,8 +145,8 @@ describe('streaming utilities', () => {
145145 const result1 = await promise1 ;
146146 const result2 = await promise2 ;
147147
148- deepStrictEqual ( result1 , [ 1 , 2 , 3 ] ) ;
149- strictEqual ( result1 , result2 ) ;
148+ assert . deepStrictEqual ( result1 , [ 1 , 2 , 3 ] ) ;
149+ assert . strictEqual ( result1 , result2 ) ;
150150 } ) ;
151151
152152 it ( 'should return different results for different keys' , async ( ) => {
@@ -163,8 +163,8 @@ describe('streaming utilities', () => {
163163 const result1 = await cache . getOrCollect ( 'key1' , gen1 ( ) ) ;
164164 const result2 = await cache . getOrCollect ( 'key2' , gen2 ( ) ) ;
165165
166- deepStrictEqual ( result1 , [ 1 , 2 ] ) ;
167- deepStrictEqual ( result2 , [ 3 , 4 ] ) ;
166+ assert . deepStrictEqual ( result1 , [ 1 , 2 ] ) ;
167+ assert . deepStrictEqual ( result2 , [ 3 , 4 ] ) ;
168168 } ) ;
169169 } ) ;
170170} ) ;
0 commit comments