Add unit tests and minimal docs #11
Loading…
Reference in a new issue
No description provided.
Delete branch "5-tests-and-docs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #5
Adds a committed bun:test suite for the pure, easily-testable functions in lib/fileDownloader.ts (getLocalPath, sanitizePathSegment, downloadsFromPlaylists) and lib/sync.ts (computeDesiredFiles/computeSongRelPaths, computeDesiredPlaylistFiles, diffDesiredVsExisting), plus a test script in package.json. Coverage is intentionally partial: downloadSongs and syncToTarget (the effectful orchestration functions) stay untested here, as previously agreed — they were manually verified in earlier steps and would require substantial fs/network mocking not worth it for a tool this size.
Also adds DESIGN.md (usage/env vars, the jellyfin/-subfolder-is-fully-managed caveat, and design decisions) and updates README.md to point at it instead of stale bun init boilerplate.
Base branch: targets 4-progress-bars (PR #10) per the stacked-PR rule in CONTRIBUTING.md, since PRs #7-#10 are all still open/unmerged as of this PR. Retarget to master once the chain merges.
This completes the download/sync rework tracked by PLANNING/MASTER_PLAN.md — every item in that task list is now checked off, pending all five PRs (#7-#11) actually merging.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.