Files
JavaScript/Project-Euler/test/Problem035.test.js
ddaniel27 0529e19426 solution: Project Euler 35 (#1201)
* [CREATE] Problem 28 solution for Project Euler

* [UPDATE] Added an explanation for the formula used in the algorithm

* [CREATE] Added Problem 35 for Project-Euler

* [UPDATE] Little typo in the error string

* [UPDATE] Some algorithm changes

* [UPDATE] Fix test string

* [UPDATE] Change prime numbers generator to import a standard sieve
algorithm.

* [UPDATE] Change sieve algorithm implementation and now the solution
works well. Also added some optimizations
2022-10-24 17:30:33 +05:30

19 lines
644 B
JavaScript

import { problem35 } from '../Problem035.js'
describe('checking circular primes', () => {
it('should be invalid input if number is negative', () => {
expect(() => problem35(-3)).toThrowError('Invalid input')
})
it('should be invalid input if number is 0', () => {
expect(() => problem35(0)).toThrowError('Invalid input')
})
// Project Euler Condition Check
test('if the number is equal to 100 result should be 13', () => {
expect(problem35(100)).toBe(13)
})
// Project Euler Challenge Check
test('if the number is equal to one million result should be 55', () => {
expect(problem35(1000000)).toBe(55)
})
})