Skip to content

test(e2e): add golden file tests for Markdown formatter variants#100

Merged
gregpriday merged 1 commit into
developfrom
feature/issue-20-add-golden-file-tests-markdown
Feb 26, 2026
Merged

test(e2e): add golden file tests for Markdown formatter variants#100
gregpriday merged 1 commit into
developfrom
feature/issue-20-add-golden-file-tests-markdown

Conversation

@gregpriday
Copy link
Copy Markdown
Owner

Summary

Adds a dedicated E2E golden file test suite for the MarkdownFormatter, pinning its output contract across all supported modes and flag combinations. Tests are deterministic across platforms and catch formatting regressions automatically.

Closes #20

Changes Made

  • Add tests/e2e/markdown-formatter.test.js with 9 test cases:
    • Base markdown output (no extra flags)
    • --with-line-numbers with format-specific line number assertions
    • --only-tree verifying the ## Files section is suppressed
    • --with-git-status with front-matter flag validation
    • Combined flags: --with-line-numbers --with-git-status
    • Combined flags: --only-tree --with-git-status
    • Fence language detection for 10 file extensions (js, css, json, yaml, python, go, rust, bash, txt, unknown)
    • Begin/end marker placement with interleaving order validation
    • --show-size (no-op for Markdown, explicitly asserted)
  • Add 8 golden files in tests/fixtures/goldens/markdown/ covering all variants
  • Follow established E2E patterns from output-formats.test.js and flags-and-combos.test.js
  • All 9 tests pass deterministically; full E2E suite (50 tests) passes without regressions

- Add tests/e2e/markdown-formatter.test.js with 9 test cases covering
  all supported Markdown output modes and flag combinations
- Test base markdown output, --with-line-numbers, --only-tree,
  --with-git-status, combined flags, and --show-size
- Add fence language detection test verifying correct syntax highlighting
  tags for js, css, json, yaml, python, go, rust, bash, txt extensions
- Add begin/end marker placement test with interleaving order validation
- Generate 8 golden files in tests/fixtures/goldens/markdown/ covering
  all variants for regression detection
- Follow existing E2E patterns from output-formats.test.js and
  flags-and-combos.test.js for consistency
@gregpriday gregpriday merged commit a21c32c into develop Feb 26, 2026
11 of 15 checks passed
@gregpriday gregpriday deleted the feature/issue-20-add-golden-file-tests-markdown branch February 26, 2026 03:24
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.

Add golden file tests for Markdown formatter variants

1 participant