mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00

* 📦 NEW: Added solution for ProjectEuler-007 * 🐛 FIX: Spelling mistake fixes * 👌 IMPROVE: changed variable name from `inc` to `candidateValue` and thrown error in case of invalid input * 👌 IMPROVE: Modified the code * 👌 IMPROVE: Added test case for ProjectEuler Problem001 * 👌 IMPROVE: Added test cases for Project Euler Problem 4 * 👌 IMPROVE: auto prettier fixes * 📦 NEW: Testcases for Project Euler Problem 14 * Updated Documentation in README.md * 👌 IMPROVE: code improvements --------- Co-authored-by: Omkarnath Parida <omkarnath.parida@yocket.in> Co-authored-by: pomkarnath98 <pomkarnath98@users.noreply.github.com>
16 lines
370 B
JavaScript
16 lines
370 B
JavaScript
import { expect } from 'vitest'
|
|
import { findLongestCollatzSequence } from '../Problem014.js'
|
|
|
|
describe('Longest Collatz Sequence', () => {
|
|
test.each([
|
|
[2, 1],
|
|
[13, 9],
|
|
[1000000, 837799]
|
|
])(
|
|
'if limit is %i, then the Longest Collatz Sequence will be %i',
|
|
(a, expected) => {
|
|
expect(findLongestCollatzSequence(a)).toBe(expected)
|
|
}
|
|
)
|
|
})
|