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 1
1
import { addBorder } from './addBorder' ;
2
2
3
- xdescribe ( addBorder . name , ( ) => {
3
+ describe ( addBorder . name , ( ) => {
4
4
it ( 'Test 1' , ( ) => {
5
5
// arrange
6
6
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 ;
3
19
}
4
20
5
- // console.log(addBorder(["abc", "ded"]));
21
+ console . log ( addBorder ( [ "abc" , "ded" ] ) ) ;
You can’t perform that action at this time.
0 commit comments