@@ -2,12 +2,9 @@ import { type ExpectType, pipe, toString } from "@scripts/common";
22import { DArray } from "@scripts" ;
33
44describe ( "join" , ( ) => {
5- it ( "joins array with separator" , ( ) => {
6- expect ( DArray . join ( [ "1" , "2" , "3" ] , "," ) ) . toBe ( "1,2,3" ) ;
7- } ) ;
8-
9- it ( "joins const array with separator" , ( ) => {
10- const result = DArray . join ( [ "1" , "2" , "3" ] as const , "-" ) ;
5+ it ( "join tuple with separator" , ( ) => {
6+ const input = [ "1" , "2" , "3" ] as const ;
7+ const result = DArray . join ( input , "-" ) ;
118
129 expect ( result ) . toBe ( "1-2-3" ) ;
1310
@@ -18,12 +15,31 @@ describe("join", () => {
1815 > ;
1916 } ) ;
2017
21- it ( "joins array using pipe with separator" , ( ) => {
18+ it ( "join array with separator" , ( ) => {
19+ const input = [ "a" , "b" , "c" ] ;
20+ const result = DArray . join ( input , "-" ) ;
21+
22+ expect ( result ) . toBe ( "a-b-c" ) ;
23+
24+ type check = ExpectType <
25+ typeof result ,
26+ string ,
27+ "strict"
28+ > ;
29+ } ) ;
30+
31+ it ( "join array using pipe with separator" , ( ) => {
2232 const result = pipe (
2333 [ 1 , 2 , 3 ] ,
2434 DArray . map ( toString ) ,
2535 DArray . join ( "-" ) ,
2636 ) ;
2737 expect ( result ) . toBe ( "1-2-3" ) ;
38+
39+ type check = ExpectType <
40+ typeof result ,
41+ string ,
42+ "strict"
43+ > ;
2844 } ) ;
2945} ) ;
0 commit comments