Skip to content

Commit a3fb79b

Browse files
LaroccaLarocca
authored andcommitted
1 parent df5014f commit a3fb79b

File tree

3 files changed

+6772
-321
lines changed

3 files changed

+6772
-321
lines changed

addBorder/addBorder.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { addBorder } from './addBorder';
22

3-
xdescribe(addBorder.name, () => {
3+
describe(addBorder.name, () => {
44
it('Test 1', () => {
55
// arrange
66
const data = ['abc, ded'];

addBorder/addBorder.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
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"]));

0 commit comments

Comments
 (0)