test: P3 — add tests for array algorithms, set, recursion, bigO, heap, tree, graph by loiane · Pull Request #258 · loiane/javascript-datastructures-algorithms · GitHub
Skip to content

test: P3 — add tests for array algorithms, set, recursion, bigO, heap, tree, graph#258

Merged
loiane merged 1 commit into
mainfrom
loiane/p3-tests
Jul 2, 2026
Merged

test: P3 — add tests for array algorithms, set, recursion, bigO, heap, tree, graph#258
loiane merged 1 commit into
mainfrom
loiane/p3-tests

Conversation

@loiane

@loiane loiane commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Adds 7 new test suites covering all P2-migrated folders plus the 03-array algorithm files.

Changes

Source: named exports added (no logic changes)

File Exports added
03-array/11-array-chunking.ts chunkArray, chunkArraySplice, chunkArrayReduce
03-array/12-flatten-arrays.ts flattenSimple, flattenDeep, flattenRecursive, flattenReduce, flattenIterative
03-array/13-remove-duplicates.ts 6 removeDuplicates* functions
03-array/14-array-rotation.ts rotateRight, rotateLeft, and 3 variants
09-recursion/02-factorial.ts factorialIterative, factorial
09-recursion/04-fibonacci.ts fibonacciIterative, fibonacci, fibonacciMemoization
02-bigOnotation/01-big-o-intro.ts + 03-exercises.ts all functions

jest.config.ts — prefer .ts over .js in moduleFileExtensions

New test files (7)

File Coverage
03-array/__test__/array-algorithms.test.ts chunking, flatten, dedup, rotation
07-set/__test__/set.test.ts MySet — CRUD, set operations
09-recursion/__test__/recursion.test.ts factorial + fibonacci (all 3 implementations)
02-bigOnotation/__test__/big-o.test.ts bigO functions
11-heap/__test__/heap.test.ts Heap<T> — insert/extract/heapify/custom comparator
10-tree/__test__/binary-search-tree.test.ts BST, AVL, Red-Black
13-graph/__test__/graph.test.ts Graph, BFS, DFS, Dijkstra, Floyd-Warshall, Kruskal, Prim

Verification

  • npx tsc --noEmit → 0 errors
  • npm test274 tests, 17 suites, all passing

…, tree, graph

- Add named exports to 03-array algorithms (chunking, flatten, dedup, rotation)
- Add named exports to 09-recursion (factorial, fibonacci)
- Add named exports to 02-bigOnotation functions
- Prefer .ts over .js in Jest moduleFileExtensions
- 7 new test suites, 274 tests total
@loiane loiane merged commit 081ad68 into main Jul 2, 2026
1 check passed
@loiane loiane deleted the loiane/p3-tests branch July 2, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant