Skip to content

Commit

Permalink
Merge pull request #1 from Oluwasetemi/oluwasetemi-patch1
Browse files Browse the repository at this point in the history
new question and improvement
  • Loading branch information
chalu authored Aug 22, 2023
2 parents dde8438 + 7216912 commit af08dab
Show file tree
Hide file tree
Showing 8 changed files with 3,556 additions and 403 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ jobs:
challenge: 'ch-1;ch-2;ch-3'
lang: javascript
server: https://api.sheetson.com/v2/sheets
sheetid: 1Qb5Ovjy1l2UG94Cht2govguYX5fpCIgoTKPUd2ufMm4
sheetid: 1aH0KkRL9BL6W7rW684LJhq66vDCEADqWAut3i9VlYSw
token: HXlur8K20ZpoB-6FNsnSUtj2kGoDqCDHDl8vZBdLtQCv9UFOVhMsM2IBwD8

35 changes: 8 additions & 27 deletions __tests__/test-challenge-1.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
const assignment = require('../src/assignment.js');

const { sumOfNumbers } = assignment;
const maybe = sumOfNumbers === undefined ? test.skip : test;
const { sumOfNumbersTo } = assignment;
const maybe = sumOfNumbersTo === undefined ? test.skip : test;

maybe('Challenge - 1 : my sumNumbers function can sum an array of numbers', () => {
const numbers = [
68,
-68,
27,
94,
72,
-25,
-51,
32,
10,
64,
-94,
4,
34,
-86,
90,
81,
20,
-56,
-91,
-50
];
expect(sumOfNumbers(numbers)).toBe(75);
});
maybe(
'Challenge - 1 : my sumOfNumbersTo function can sum an array of numbers',
() => {
expect(sumOfNumbersTo(10)).toBe(55);
}
);
31 changes: 5 additions & 26 deletions __tests__/test-challenge-2.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
const assignment = require('../src/assignment.js');

const { countEvenNumbers } = assignment;
const maybe = countEvenNumbers === undefined ? test.skip : test;
const { countEvenNumbersWithin } = assignment;
const maybe = countEvenNumbersWithin === undefined ? test.skip : test;

maybe('Challenge - 2 : my countEvenNumbers function can count even numbers in array of numbers', () => {
const numbers = [
17,
0,
67,
41,
49,
21,
1,
86,
76,
2,
54,
14,
93,
84,
14,
77,
35,
7,
29,
64
]
expect(countEvenNumbers(numbers)).toBe(9);
maybe('Challenge - 2 : my countEvenNumbersWithin function can count even numbers in array of numbers', () => {

expect(countEvenNumbersWithin(10)).toStrictEqual({ count: 5, sum: 30, arrayOfEvenNumbers: [2, 4, 6, 8, 10] });
});
49 changes: 3 additions & 46 deletions __tests__/test-challenge-3.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,7 @@ const assignment = require('../src/assignment.js');
const { celsiusToFahrenheit } = assignment;
const maybe = celsiusToFahrenheit === undefined ? test.skip : test;

maybe('Challenge - 3 : my celsiusToFahrenheit function can convert an array of temperatures', () => {
const numbers = [
24,
30,
14,
-8,
22,
17,
-5,
25,
2,
25,
10,
10,
28,
33,
39,
28,
23,
-1,
2,
-4
]
const converted = [
75,
86,
57,
17,
71,
62,
23,
77,
35,
77,
50,
50,
82,
91,
102,
82,
73,
30,
35,
24
];
expect(celsiusToFahrenheit(numbers)).toEqual(converted);
maybe('Challenge - 3 : my celsiusToFahrenheit function can convert an array of temperatures', async () => {

expect(celsiusToFahrenheit([ 51.21, 23, 0, -55, 100 ])).toStrictEqual([ 124, 73, 32, -67, 212 ]);
});
Loading

0 comments on commit af08dab

Please sign in to comment.