Appearance
E2E Testing Report
中文版请查看 e2e-testing-report.zh-CN.md。
This document summarizes the end-to-end markdown parsing tests added to this repository.
Purpose
Provide a small, reproducible E2E test harness that validates the parser and renderer handle common markdown constructs and to serve as a base for future coverage expansion.
What was added
test/fixtures/— directory with representative markdown fixtures:headings.mdcode-diff.mdtable.mdadmonition.mdmath.mdfootnotes.mdimage-link.mdcheckbox.mdmermaid.md
test/e2e.markdown.test.ts— a Vitest test that:- reads each fixture
- parses it via
parseMarkdownToStructure(usinggetMarkdowninstance) - serializes a minimal stable structure and asserts a snapshot per fixture
- includes a small
renderMarkdownassertion for inline math/code block rendering
Snapshots — generated by Vitest (placed in the default snapshot location).
.github/workflows/ci.yml— GitHub Actions workflow that runs onpushandpull_requestto:- install dependencies
- run
pnpm test - run
pnpm typecheck - run
pnpm lint
How to run locally
Run tests (and update snapshots if you intentionally changed output):
bash
pnpm test -- -uRun tests without updating snapshots:
bash
pnpm testTypecheck and lint:
bash
pnpm typecheck
pnpm lintQuality gates (local validation)
- Tests: PASS (73 passed locally)
- Typecheck: PASS
- Lint: PASS
Recommendations / Next steps
- Convert snapshots to include more detailed fields in
minimalserialization (for example, includechildrentext snippets or nodemeta), to catch regressions in node payloads. - Add fixtures for edge cases:
- Unclosed fences
- Complex nested lists with markup inside
- Escaped bracket edge-cases
- Streaming fence edgecases
- Add integration tests for rendering plugins that require DOM or workers (Mermaid, KaTeX worker, Monaco). Consider adding a browser-based test job (Playwright) for those.
- Configure CI to run snapshots or a visual regression step if the renderer's HTML output becomes more important.
If you want, I can:
- Expand snapshots to include richer metadata (children snippets, meta fields).
- Add the proposed edge-case fixtures and assertions.
- Draft a Playwright-based CI job for DOM-heavy plugins.
Let me know which option you’d prefer next。