Add tests for Project euler problem 14 solution (#1713)

* 📦 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>
This commit is contained in:
Omkarnath Parida
2024-11-16 21:38:17 +05:30
committed by GitHub
parent 55ff0ade85
commit d8588f9de1

View File

@ -0,0 +1,15 @@
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)
}
)
})