mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-19 21:09:51 +08:00
chore(curriculum) : update Project Euler tests with better assertions (#60728)
Co-authored-by: @Vishal-Telukula <telukulasunitha@gmail.com>
This commit is contained in:
parent
ee681ff4ad
commit
2be423e928
@ -17,7 +17,7 @@ Find the sum of all the multiples of 3 or 5 below the provided parameter value `
|
||||
`multiplesOf3Or5(10)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof multiplesOf3Or5(10) === 'number');
|
||||
assert.isNumber(multiplesOf3Or5(10));
|
||||
```
|
||||
|
||||
`multiplesOf3Or5(49)` should return 543.
|
||||
|
||||
@ -17,7 +17,7 @@ Find the sum of all the primes below `n`.
|
||||
`primeSummation(17)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof primeSummation(17) === 'number');
|
||||
assert.isNumber(primeSummation(17));
|
||||
```
|
||||
|
||||
`primeSummation(17)` should return 41.
|
||||
|
||||
@ -19,7 +19,7 @@ By considering the terms in the Fibonacci sequence whose values do not exceed `n
|
||||
`fiboEvenSum(10)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof fiboEvenSum(10) === 'number');
|
||||
assert.isNumber(fiboEvenSum(10));
|
||||
```
|
||||
|
||||
Your function should return an even value.
|
||||
|
||||
@ -17,7 +17,7 @@ What is the largest prime factor of the given `number`?
|
||||
`largestPrimeFactor(2)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof largestPrimeFactor(2) === 'number');
|
||||
assert.isNumber(largestPrimeFactor(2));
|
||||
```
|
||||
|
||||
`largestPrimeFactor(2)` should return 2.
|
||||
|
||||
@ -17,7 +17,7 @@ Find the largest palindrome made from the product of two `n`-digit numbers.
|
||||
`largestPalindromeProduct(2)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof largestPalindromeProduct(2) === 'number');
|
||||
assert.isNumber(largestPalindromeProduct(2));
|
||||
```
|
||||
|
||||
`largestPalindromeProduct(2)` should return 9009.
|
||||
|
||||
@ -17,7 +17,7 @@ What is the smallest positive number that is evenly divisible by all of the numb
|
||||
`smallestMult(5)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof smallestMult(5) === 'number');
|
||||
assert.isNumber(smallestMult(5));
|
||||
```
|
||||
|
||||
`smallestMult(5)` should return 60.
|
||||
|
||||
@ -25,7 +25,7 @@ Find the difference between the sum of the squares of the first `n` natural numb
|
||||
`sumSquareDifference(10)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof sumSquareDifference(10) === 'number');
|
||||
assert.isNumber(sumSquareDifference(10));
|
||||
```
|
||||
|
||||
`sumSquareDifference(10)` should return 2640.
|
||||
|
||||
@ -17,7 +17,7 @@ What is the `n`th prime number?
|
||||
`nthPrime(6)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof nthPrime(6) === 'number');
|
||||
assert.isNumber(nthPrime(6));
|
||||
```
|
||||
|
||||
`nthPrime(6)` should return 13.
|
||||
|
||||
@ -38,7 +38,7 @@ Find the `n` adjacent digits in the 1000-digit number that have the greatest pro
|
||||
`largestProductinaSeries(4)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof largestProductinaSeries(4) === 'number');
|
||||
assert.isNumber(largestProductinaSeries(4));
|
||||
```
|
||||
|
||||
`largestProductinaSeries(4)` should return 5832.
|
||||
|
||||
@ -21,7 +21,7 @@ There exists exactly one Pythagorean triplet for which `a` + `b` + `c` = 1000. F
|
||||
`specialPythagoreanTriplet(24)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof specialPythagoreanTriplet(24) === 'number');
|
||||
assert.isNumber(specialPythagoreanTriplet(24));
|
||||
```
|
||||
|
||||
`specialPythagoreanTriplet(24)` should return 480.
|
||||
@ -33,7 +33,7 @@ assert.strictEqual(specialPythagoreanTriplet(24), 480);
|
||||
`specialPythagoreanTriplet(120)` should return 49920, 55080 or 60000.
|
||||
|
||||
```js
|
||||
assert([49920, 55080, 60000].includes(specialPythagoreanTriplet(120)));
|
||||
assert.oneOf(specialPythagoreanTriplet(120), [49920, 55080, 60000]);
|
||||
```
|
||||
|
||||
`specialPythagoreanTriplet(1000)` should return 31875000.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user