mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
algorithm: sieve (#1205)
This commit is contained in:
12
Maths/test/SieveOfEratosthenesIntArray.test.js
Normal file
12
Maths/test/SieveOfEratosthenesIntArray.test.js
Normal file
@ -0,0 +1,12 @@
|
||||
import { sieveOfEratosthenes } from '../SieveOfEratosthenesIntArray'
|
||||
import { PrimeCheck } from '../PrimeCheck'
|
||||
|
||||
describe('should return an array of prime numbers', () => {
|
||||
it('should have each element in the array as a prime numbers', () => {
|
||||
const n = 100
|
||||
const primes = sieveOfEratosthenes(n)
|
||||
primes.forEach(prime => {
|
||||
expect(PrimeCheck(prime)).toBeTruthy()
|
||||
})
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user