Skip to content

Commit

Permalink
Add tests for Project euler problem 14 solution (#1713)
Browse files Browse the repository at this point in the history
* 📦 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 <[email protected]>
Co-authored-by: pomkarnath98 <[email protected]>
  • Loading branch information
3 people authored Nov 16, 2024
1 parent 55ff0ad commit d8588f9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Project-Euler/test/Problem014.test.js
Original file line number Diff line number Diff line change
@@ -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)
}
)
})

0 comments on commit d8588f9

Please sign in to comment.