2022-10-15 04:08:48 -05:00
|
|
|
import { problem44 } from '../Problem044.js'
|
|
|
|
|
|
|
|
|
|
describe('checking nth prime number', () => {
|
2022-10-20 15:59:09 +02:00
|
|
|
test('should be invalid input if number is negative', () => {
|
2022-10-15 04:08:48 -05:00
|
|
|
expect(() => problem44(-3)).toThrowError('Invalid Input')
|
|
|
|
|
})
|
2022-10-20 15:59:09 +02:00
|
|
|
test('should be invalid input if number is 0', () => {
|
2022-10-15 04:08:48 -05:00
|
|
|
expect(() => problem44(0)).toThrowError('Invalid Input')
|
|
|
|
|
})
|
|
|
|
|
// Project Euler Condition Check
|
|
|
|
|
test('if the number is greater or equal to 1', () => {
|
|
|
|
|
expect(problem44(1)).toBe(5482660)
|
|
|
|
|
})
|
|
|
|
|
// Project Euler Second Value for Condition Check
|
2023-10-03 23:08:19 +02:00
|
|
|
test('if the number is greater or equal to 2167', () => {
|
2022-10-15 04:08:48 -05:00
|
|
|
expect(problem44(2167)).toBe(8476206790)
|
|
|
|
|
})
|
|
|
|
|
})
|