Skip to content

test(mdxg): mount the router spec in a component instance - #591

Merged
harlan-zw merged 1 commit into
mainfrom
fix/issue-587
Oct 9, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/issue-587

Conversation

@harlan-github-agent

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Closes #587

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Every site / test run logged [Vue warn]: onBeforeUnmount is called when there is no active component instance to be associated with. seven times from document-router.spec.ts. The spec called useMdxgDocumentRouter outside setup, so the cleanup hook never registered and each test leaked a popstate listener on window.

The spec now runs the composable inside a mounted dummy component through a withSetup helper, and an afterEach hook unmounts every app so the listener comes off. The file's warning count drops to zero.

Two notes for review. The cited runs carried 112 such warnings in total; this change clears only the 7 from document-router.spec.ts, so the remaining sources deserve their own pass. And on a local machine the default vitest reporter hides console output from passing tests, so the before and after counts were compared with --reporter=verbose.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 9, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-09 02:48 UTC.

GitHub merged this pull request.

No material findings were recorded.

5d69cc84-6cd6-4f7b-804c-5cae23cbeca6

@harlan-github-agent harlan-github-agent Bot added harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 9, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

@harlan-zw
harlan-zw merged commit 6e5028f into main Oct 9, 2026
8 checks passed
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Oct 9, 2026
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.

Mdxg router spec runs composable outside a component instance

1 participant