Add tests for Project Euler Problem 5 + minor refactor (#1691)

This commit is contained in:
Omkarnath Parida
2024-10-09 05:24:11 +05:30
committed by GitHub
parent 18da83a5b7
commit ff314a2bed
3 changed files with 18 additions and 5 deletions

View 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)
})
})