Skip to content

Commit a1117ef

Browse files
👌 IMPROVE: test cases writing imrovements
1 parent 5f7d046 commit a1117ef

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Diff for: Project-Euler/test/Problem005.test.js

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1+
import { expect } from 'vitest'
12
import { findSmallestMultiple } from '../Problem005.js'
23

34
describe.concurrent('Find smallest multiple', () => {
4-
test('if max divisor is 10', () => {
5-
expect(findSmallestMultiple(10)).toBe(2520)
6-
})
7-
test('if max divisor is 15', () => {
8-
expect(findSmallestMultiple(15)).toBe(360360)
9-
})
10-
11-
// Project Euler Condition Check
12-
test('if max divisor is 20', () => {
13-
expect(findSmallestMultiple(20)).toBe(232792560)
5+
test.each([
6+
[10, 2520],
7+
[15, 360360],
8+
[20, 232792560]
9+
])('max divisor -> %i, smallest multiple -> %i', (a, expected) => {
10+
expect(findSmallestMultiple(a)).toBe(expected)
1411
})
1512
})

0 commit comments

Comments
 (0)