File tree Expand file tree Collapse file tree 3 files changed +6772
-321
lines changed
Expand file tree Collapse file tree 3 files changed +6772
-321
lines changed Original file line number Diff line number Diff line change 11import { addBorder } from './addBorder' ;
22
3- xdescribe ( addBorder . name , ( ) => {
3+ describe ( addBorder . name , ( ) => {
44 it ( 'Test 1' , ( ) => {
55 // arrange
66 const data = [ 'abc, ded' ] ;
Original file line number Diff line number Diff line change 1- export function addBorder ( picture : string [ ] ) : string [ ] {
2-
1+ export function addBorder ( picture : string [ ] ) : any {
2+ let borderStars : string = `` ;
3+ let stringArray : string [ ] = [ ] ;
4+
5+ for ( let i = 0 ; i < picture [ 0 ] . length + 2 ; i ++ ) {
6+ borderStars += '*' ;
7+ }
8+
9+ stringArray . push ( borderStars ) ;
10+
11+ for ( let i = 0 ; i < picture . length ; i ++ ) {
12+ stringArray . push ( `*${ picture [ i ] } *` ) ;
13+ }
14+
15+ stringArray . push ( borderStars ) ;
16+ console . log ( borderStars . length ) ;
17+ console . log ( stringArray ) ;
18+ return stringArray ;
319}
420
5- // console.log(addBorder(["abc", "ded"]));
21+ console . log ( addBorder ( [ "abc" , "ded" ] ) ) ;
You can’t perform that action at this time.
0 commit comments