mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 17:50:39 +08:00
Add tests for Project Euler Problem 5 + minor refactor (#1691)
This commit is contained in:
12
Project-Euler/test/Problem005.test.js
Normal file
12
Project-Euler/test/Problem005.test.js
Normal file
@ -0,0 +1,12 @@
|
||||
import { expect } from 'vitest'
|
||||
import { findSmallestMultiple } from '../Problem005.js'
|
||||
|
||||
describe.concurrent('Find smallest multiple', () => {
|
||||
test.each([
|
||||
[10, 2520],
|
||||
[15, 360360],
|
||||
[20, 232792560]
|
||||
])('max divisor -> %i, smallest multiple -> %i', (a, expected) => {
|
||||
expect(findSmallestMultiple(a)).toBe(expected)
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user