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

Project-Euler/test/Problem005.test.js

Lines changed: 7 additions & 10 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy