test(import): cover landing stubs, api/docs rescue, and staging layout - #44
Merged
Conversation
Add regression tests for recent import fixes that shipped without coverage: section landing-page injection, /api/docs vs reference classification, parent index.md staging, and llms.txt (section) title stripping. Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
erunion
self-requested a review
August 27, 2026 17:00
erunion
marked this pull request as ready for review
August 27, 2026 17:02
erunion
approved these changes
Aug 27, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧰 Changes
Adds regression tests for recent import fixes that shipped without coverage. Production behavior is unchanged aside from exposing existing helpers on
import.js's__test__hook.Risky behavior now covered
meta refresh, canonical-to-child, HTTP redirect-to-child), import-base probes, single-child categories, 404s, and fetch failures are skipped./api/docsvs API reference — guides under/api/docs/*stay docs;/api/docs/api|reference|api-referenceand/api/reference/*stay reference.skipApiReferencestaging rescues the docs subtree instead of dropping it.index.mdinside the folder (not a sibling<slug>.md); nested category folders that share a basename are namespaced and backed by a titledindex.md; YAML-unsafe slugs are quoted in_order.yaml.&, zero-width chars).(section)markers — trailing(section)is stripped from H2/H3 titles so it never becomes a sidebar category name.Test files added/updated
src/commands/import.landing.test.js(added)src/commands/import.classify.test.js(added)src/commands/import.staging.test.js(added)src/utils/llms.test.js(updated)src/commands/import.js(__test__exports only)Why these tests materially reduce regression risk
These paths decide what gets imported, how pages are classified (docs vs reference vs changelog vs auth chrome), and how the sidebar is written to disk. The recent fixes for empty parent pages (#32),
/api/docsmisclassification (#28), client-redirect stub landings (#29), and(section)titles (#25) had no tests; a future organize/staging change could silently drop guides, invent stub section pages, or write contentless sidebar parents.🧬 QA & Testing
npm testAll 154 tests passed, including the new import/llms coverage. Tests are deterministic (mocked
fetch, temp staging dirs) and do not depend on live sites.