test(bot): add spec coverage for the remaining #2055 music commands
Summary
lyrics, seek, shuffle, skipto, leavecleanup, songinfo, and the music command-loader index.ts had no spec while every other command in packages/bot/src/functions/music/commands/ does. /album shipped 100% broken for every text query and stayed that way until #2053 precisely because it had no spec either (#2050) - same risk class here.
music.ts, session.ts, and effects.ts (the three largest, per #2055's own scope split) already got their specs in separate prior PRs (#2056, #2263, #2262); this closes out the rest of that parent issue's inventory in one batch since none of them touch production code or depend on each other.
Coverage added
- lyrics: feature-toggle gate, blank-query-outside-guild rejection, falling back to the now-playing track (including its unknown-title/no-author case), the not-found and thrown-error branches, and paging multi-page results across follow-ups
- seek: every mm:ss/ss parse-failure shape, the no-duration and beyond-duration rejections, and the parse/format round-trip on success
- shuffle: the <2-tracks rejection, the random-vs-smart branch (including the no-subcommand default), and that smart shuffle clears and rebuilds the queue in the shuffled order
- skipto: the beyond-queue-size rejection vs the exactly-at-boundary accept, and the generic-vs-track-embed reply depending on whether a track exists at the target index
- leavecleanup: no-voice-channel guard, removing only tracks whose requester left, singular/plural wording, and that a throw during one track's removal doesn't stop the rest
- songinfo: the null-vs-present progress bar branch
- index.ts: mirrors the existing source-inspection pattern already used for the automod/management/moderation command loaders, since the real function can't run under jest's CJS transform of
import.meta.url
Test plan
- All 7 new spec files pass (55 tests total)
- Verified each new assertion actually fails against a mutated implementation of its command (one targeted mutation per file: a flipped/loosened guard condition, a dropped filter, a hardcoded default) before confirming it passes against the real code - the same check that would have caught #2050
-
npx tsc -p packages/bot --noEmitclean - No production code changed - test-only PR
Closes #2055
Summary by cubic
Adds spec coverage for the six untested music commands in packages/bot, closing the coverage gap from #2055 so regressions like the one that broke /album are caught. No production code changed.
Coverage added
lyrics: toggle gate, blank-query rejection, now-playing fallback, error branches, and multi-page follow-ups.seek: parse failures, duration rejections, and success round-trip.shuffle: minimum track count, random vs. smart (including default), and smart queue rebuild.skipto: boundary validation and generic vs. track-embed replies.leavecleanup: guards, requester filter, pluralization, and error resilience.songinfo: progress bar present/null branches.
A spec for the command-loader index.ts was attempted and dropped: import.meta.url can't be parsed under the repo's CJS jest transform, and the loader logic is already covered by getCommandsFromDirectory.spec.ts.
Every assertion was verified to fail against a mutated implementation, and tsc is clean.