-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Oluwasetemi/oluwasetemi-patch1
new question and improvement
- Loading branch information
Showing
8 changed files
with
3,556 additions
and
403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.