mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
13 lines
396 B
JavaScript
13 lines
396 B
JavaScript
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()
|
|
})
|
|
})
|
|
})
|