Commit fe3c482
committed
test(github): add comprehensive parser utility tests
Adds 47 tests for GitHub parser utilities (32 passing, 15 failing):
**Tests Passing (32):**
- Issue reference extraction (#123 format)
- File path detection
- @mention extraction
- URL extraction
- Document enrichment
- Query matching (title/body/labels)
- Relevance scoring (relative comparisons)
**Tests Failing (15) - Found Implementation Bugs:**
1. extractIssueReferences - wrong sort order
2. extractIssueReferences - accepts #0 (invalid)
3. extractFilePaths - regex too strict, misses simple names
4. extractMentions - incorrectly matches emails
5. extractGitHubReferences - missing pullRequests property
6. matchesQuery - doesn't handle number matching
7. calculateRelevance - scoring too low
8. extractKeywords - TypeError on toLowerCase
**Coverage: 100% of parser.ts functions tested**
This demonstrates our testing gold standard:
- Write tests for pure functions first
- Tests reveal bugs before code ships
- High confidence in refactoring
Next: Fix implementation to make all tests pass ✅1 parent 173baf3 commit fe3c482
1 file changed
+474
-0
lines changed
0 commit comments