Commit Graph

4 Commits

  • test: add 3 tests for evaluate-session regex, empty rules/skills dirs (Round 65)
    - evaluate-session.js: verify regex whitespace tolerance around colon
      matches "type" : "user" (with spaces), not just compact JSON
    - validate-rules.js: empty directory with no .md files yields Validated 0
    - validate-skills.js: directory with only files, no subdirectories yields
      Validated 0
    
    Total: 800 tests, all passing
  • test: add env var fallback, console.log max matches, and format non-existent file tests
    Round 53: Adds 3 hook tests — validates evaluate-session.js
    falls back to CLAUDE_TRANSCRIPT_PATH env var when stdin JSON
    is invalid, post-edit-console-warn.js truncates output to max
    5 matches, and post-edit-format.js passes through data when
    the target .tsx file doesn't exist.
  • test: add 22 tests for readStdinJson, evaluate-session config, and suggest-compact hook
    - utils.test.js: 5 tests for readStdinJson maxSize truncation, whitespace-only stdin, trailing whitespace, and BOM prefix handling
    - evaluate-session.test.js: 4 tests for config file parsing, assistant-only transcripts, malformed JSON lines, and empty stdin
    - suggest-compact.test.js: 13 new tests covering counter file creation/increment, threshold suggestion, interval suggestion, env var handling, corrupted/empty counter files, and session isolation
  • fix: greedy regex in validate-commands captures all refs per line, add 18 tests
    The command cross-reference regex /^.*`\/(...)`.*$/gm only captured the
    LAST command ref per line due to greedy .* consuming earlier refs.
    Replaced with line-by-line processing using non-anchored regex to
    capture ALL command references.
    
    New tests:
    - 4 validate-commands multi-ref-per-line tests (regression)
    - 8 evaluate-session threshold boundary tests (new file)
    - 6 session-aliases edge case tests (cleanup, rename, path matching)