File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -294,17 +294,21 @@ Deno.test("isOneOf<T>", async (t) => {
294294 } ) ;
295295} ) ;
296296
297- Deno . test ( "is defines aliases of functions " , async ( ) => {
297+ Deno . test ( "is" , async ( t ) => {
298298 const mod = await import ( "./is.ts" ) ;
299- const cases = Object . entries ( mod )
299+ const casesOfAliasAndIsFunction = Object . entries ( mod )
300300 . filter ( ( [ k , _ ] ) => k . startsWith ( "is" ) )
301301 . map ( ( [ k , v ] ) => [ k . slice ( 2 ) , v ] as const ) ;
302- for ( const [ alias , fn ] of cases ) {
303- assertStrictEquals ( is [ alias as keyof typeof is ] , fn ) ;
302+ for ( const [ alias , fn ] of casesOfAliasAndIsFunction ) {
303+ await t . step ( `defines \`${ alias } \` function` , ( ) => {
304+ assertStrictEquals ( is [ alias as keyof typeof is ] , fn ) ;
305+ } ) ;
304306 }
305- assertEquals (
306- Object . keys ( is ) . length ,
307- cases . length ,
308- "The number of entries in `is` is not equal to `is*` functions" ,
307+ await t . step (
308+ "only has entries that are the same as the `is*` function aliases" ,
309+ ( ) => {
310+ const aliases = casesOfAliasAndIsFunction . map ( ( [ a ] ) => a ) . toSorted ( ) ;
311+ assertEquals ( Object . keys ( is ) . toSorted ( ) , aliases ) ;
312+ } ,
309313 ) ;
310314} ) ;
You can’t perform that action at this time.
0 commit comments