Skip to content

Commit df5014f

Browse files
authored
Merge pull request Dylan-Israel#9 from PizzaPokerGuy/testingAddition
Testing addition
2 parents 511413c + 5a5d8a4 commit df5014f

File tree

228 files changed

+8322
-374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+8322
-374
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { absoluteValuesSumMinimization } from './absoluteValuesSumMinization';
2+
3+
xdescribe(absoluteValuesSumMinimization.name, () => {
4+
it('Test 1', () => {
5+
// arrange
6+
const data = [2, 4, 7];
7+
8+
// act
9+
const response = absoluteValuesSumMinimization(data);
10+
11+
// assert
12+
expect(response).toBe(4);
13+
});
14+
15+
it('Test 2', () => {
16+
// arrange
17+
const data = [2, 4, 7, 6];
18+
19+
// act
20+
const response = absoluteValuesSumMinimization(data);
21+
22+
// assert
23+
expect(response).toBe(4);
24+
});
25+
26+
it('Test 3', () => {
27+
// arrange
28+
const data = [2, 4, 7, 6, 6];
29+
30+
// act
31+
const response = absoluteValuesSumMinimization(data);
32+
33+
// assert
34+
expect(response).toBe(7);
35+
});
36+
37+
it('Test 4', () => {
38+
// arrange
39+
const data = [2, 4, 7, 6, 6, 8];
40+
41+
// act
42+
const response = absoluteValuesSumMinimization(data);
43+
44+
// assert
45+
expect(response).toBe(7);
46+
});
47+
});

absoluteValuesSumMinization/absoluteValuesSumMinization.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
function absoluteValuesSumMinimization(a: number[]): number {
2-
1+
export function absoluteValuesSumMinimization(a: number[]): number {
2+
return 5;
33
}
44

55
// console.log(absoluteValuesSumMinimization([2, 4, 7]));

add/add.spec.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { add, add2 } from './add';
2+
3+
xdescribe(add.name, () => {
4+
it('test 1', () => {
5+
// act
6+
const result = add(1, 2);
7+
8+
// assert
9+
expect(result).toBe(3);
10+
});
11+
12+
it('test 2', () => {
13+
// act
14+
const result = add(3, 2);
15+
16+
// assert
17+
expect(result).toBe(5);
18+
});
19+
});
20+
21+
xdescribe(add2.name, () => {
22+
// console.log(add2(2,3));
23+
it('test 1', () => {
24+
// arrange
25+
const data = [1, 2, 3, 4, 5];
26+
27+
// act
28+
const result = add2(...data);
29+
30+
// assert
31+
expect(result).toBe(15);
32+
});
33+
34+
it('test 2', () => {
35+
// arrange
36+
const data = [2, 3];
37+
38+
// act
39+
const result = add2(...data);
40+
41+
// assert
42+
expect(result).toBe(5);
43+
});
44+
});

add/add.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
function add(param1: number, param2: number): number {
1+
export function add(param1: number, param2: number): number {
22

33
}
44

5-
// function add2(param1: number[]): number {
5+
export function add2(...param1: number[]): number {
66

7-
// }
7+
}
88
// console.log(add(1, 2));
99
// console.log(add(3, 2));
1010

1111
// console.log(add2(1,2,3,4,5));
1212
// console.log(add2(2,3));
13-

addBorder/addBorder.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { addBorder } from './addBorder';
2+
3+
xdescribe(addBorder.name, () => {
4+
it('Test 1', () => {
5+
// arrange
6+
const data = ['abc, ded'];
7+
8+
// act
9+
const response = addBorder(data);
10+
11+
// assert
12+
expect(response).toEqual([
13+
"*****",
14+
"*abc*",
15+
"*ded*",
16+
"*****"
17+
]);
18+
});
19+
});

addBorder/addBorder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function addBorder(picture: string[]): string[] {
1+
export function addBorder(picture: string[]): string[] {
22

33
}
44

addTwoDigits/addTwoDigits.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { addTwoDigits } from './addTwoDigits';
2+
3+
xdescribe(addTwoDigits.name, () => {
4+
it('Test 1', () => {
5+
// arrange
6+
const data = 29;
7+
8+
// act
9+
const response = addTwoDigits(data);
10+
11+
// assert
12+
expect(response).toBe(11);
13+
});
14+
});

addTwoDigits/addTwoDigits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function addTwoDigits(n: any): number {
1+
export function addTwoDigits(n: any): number {
22

33
}
44

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { adjacentElementsProduct } from './adjacentElementsProduct';
2+
3+
xdescribe(adjacentElementsProduct.name, () => {
4+
it('Test 1', () => {
5+
// arrange
6+
const data = [3, 6, -2, -5, 7, 3];
7+
8+
// act
9+
const response = adjacentElementsProduct(data);
10+
11+
// assert
12+
expect(response).toBe(21);
13+
});
14+
});

0 commit comments

Comments
 (0)