mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
tests: Project Euler Problem 3 (#1207)
This commit is contained in:
12
Project-Euler/test/Problem003.test.js
Normal file
12
Project-Euler/test/Problem003.test.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { largestPrime } from '../Problem003.js'
|
||||||
|
|
||||||
|
describe('Largest prime factor', () => {
|
||||||
|
test('if the number is 13195', () => {
|
||||||
|
expect(largestPrime(13195)).toBe(29)
|
||||||
|
})
|
||||||
|
// Project Euler Condition Check
|
||||||
|
test('if the number is 600851475143', () => {
|
||||||
|
// Default value is same as the tested value
|
||||||
|
expect(largestPrime()).toBe(6857)
|
||||||
|
})
|
||||||
|
})
|
Reference in New Issue
Block a user