Follow-up to #5. Small, pure unit tests — the closest match to the seed spec's style and a good first contribution. No temp dir needed for most of these (pure functions).
Scope & cases
src/core/paths.ts
statusLineCommand(path): leaves a space-free path unquoted (bash /p/tokenline.sh); quotes a path containing a space (bash "/My Drive/tokenline.sh").
claudeDir / scriptTarget / settingsTarget: --global vs project, and --dir override resolution.
src/core/settings.ts (remaining helpers)
isTokenlineCommand(cmd): matches .../tokenline.sh commands; false for undefined, empty, or a foreign command.
backup(file): copies file → file.bak (temp-dir test, reuse the seed spec's pattern).
src/cli.ts — parseArgs
- Parses
--global / --dry-run / --force / --purge / --dir <path> and the -h/-v aliases.
- Collects unknown
-flags into unknown and positionals into _.
- (May need
parseArgs exported for direct testing — small refactor.)
Acceptance
pnpm test stays green locally and in CI.
- The cases above are covered.
Follow-up to #5. Small, pure unit tests — the closest match to the seed spec's style and a good first contribution. No temp dir needed for most of these (pure functions).
Scope & cases
src/core/paths.tsstatusLineCommand(path): leaves a space-free path unquoted (bash /p/tokenline.sh); quotes a path containing a space (bash "/My Drive/tokenline.sh").claudeDir/scriptTarget/settingsTarget:--globalvs project, and--diroverride resolution.src/core/settings.ts(remaining helpers)isTokenlineCommand(cmd): matches.../tokenline.shcommands;falseforundefined, empty, or a foreign command.backup(file): copiesfile→file.bak(temp-dir test, reuse the seed spec's pattern).src/cli.ts—parseArgs--global/--dry-run/--force/--purge/--dir <path>and the-h/-valiases.-flagsintounknownand positionals into_.parseArgsexported for direct testing — small refactor.)Acceptance
pnpm teststays green locally and in CI.