Skip to content

test: add 69 tests across core and cli-analyzer#2

Open
wgsim wants to merge 2 commits intomainfrom
test-coverage-expansion
Open

test: add 69 tests across core and cli-analyzer#2
wgsim wants to merge 2 commits intomainfrom
test-coverage-expansion

Conversation

@wgsim
Copy link
Copy Markdown
Owner

@wgsim wgsim commented Mar 4, 2026

Summary

  • Move escHtml from extension.ts to packages/core/src/utils.ts and export from core index
  • Add parseAnalyzeArgs / buildAnalysisJson as exported pure functions in cli.ts
  • Add 69 tests covering previously untested core logic

New Test Files

File Tests
core/src/utils.test.ts 7 — escHtml HTML escaping
core/src/session-parsers/claude-code.test.ts 18 — encodeProjectPath, isMeaningfulPrompt, parseSessionFile
core/src/session-parsers/codex-cli.test.ts 11 — parseSessionFile (all Codex JSONL formats)
core/src/static-analyzer.test.ts 23 — analyzeSession (counts, tokens, Write/Edit/exec_command, changeFrequency)
cli-analyzer/src/cli.test.ts 10 — parseAnalyzeArgs, buildAnalysisJson

Test Plan

  • pnpm run build passes in packages/core and packages/cli-analyzer
  • node --test dist/**/*.test.js — 59/59 pass in core
  • node --test dist/cli.test.js — 10/10 pass in cli-analyzer
  • All 69 tests pass with zero failures

🤖 Generated with Claude Code

wgsim and others added 2 commits March 3, 2026 12:30
- Move escHtml from extension.ts to packages/core/src/utils.ts and export
- Add parseAnalyzeArgs / buildAnalysisJson as exported functions in cli.ts
- New: utils.test.ts (7 tests for escHtml)
- New: session-parsers/claude-code.test.ts (18 tests: encodeProjectPath, isMeaningfulPrompt, parseSessionFile)
- New: session-parsers/codex-cli.test.ts (11 tests: parseSessionFile with mocked JSONL)
- New: static-analyzer.test.ts (23 tests: counts, tokens, Write/Edit/exec_command, changeFrequency)
- New: cli-analyzer/cli.test.ts (10 tests: parseAnalyzeArgs, buildAnalysisJson)
- Update package.json test scripts in core and cli-analyzer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant