Add unit tests and minimal docs #11

Open
r2d2-bot wants to merge 2 commits from 5-tests-and-docs into 4-progress-bars
Collaborator

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.

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.
Adds a committed bun:test suite for the pure, easily-testable functions in
lib/fileDownloader.ts and lib/sync.ts (getLocalPath, sanitizePathSegment,
downloadsFromPlaylists, computeDesiredFiles/computeSongRelPaths,
computeDesiredPlaylistFiles, diffDesiredVsExisting), plus a `test` script
in package.json. Coverage is intentionally partial: the effectful
orchestration functions (downloadSongs, syncToTarget) stay untested here,
as previously agreed, since they were already manually verified in prior
steps and would require heavy fs/network mocking.

Also adds DESIGN.md (usage/env vars, the jellyfin/-subfolder-is-fully-
managed caveat, and design decisions) and updates README.md to reference
the download/sync commands instead of stale bun init boilerplate.

Closes #5

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EncvBjUkvZfEutPhyYJHeB
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 5-tests-and-docs:5-tests-and-docs
git switch 5-tests-and-docs

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.

git switch 4-progress-bars
git merge --no-ff 5-tests-and-docs
git switch 5-tests-and-docs
git rebase 4-progress-bars
git switch 4-progress-bars
git merge --ff-only 5-tests-and-docs
git switch 5-tests-and-docs
git rebase 4-progress-bars
git switch 4-progress-bars
git merge --no-ff 5-tests-and-docs
git switch 4-progress-bars
git merge --squash 5-tests-and-docs
git switch 4-progress-bars
git merge --ff-only 5-tests-and-docs
git switch 4-progress-bars
git merge 5-tests-and-docs
git push origin 4-progress-bars
Sign in to join this conversation.
No reviewers
No labels
m3u_files
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jshaver/jellyfin-to-m3u!11
No description provided.