Repository navigation
test(mdxg): mount the router spec in a component instance - #591
Merged
Merged
Conversation
Contributor
Author
🤖 MERGED
GitHub merged this pull request. No material findings were recorded. 5d69cc84-6cd6-4f7b-804c-5cae23cbeca6 |
Contributor
Author
There was a problem hiding this comment.
Harlan Agent Kit posted this automated review. AI open source policy.
Automated Review: READY.
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.
🔗 Linked issue
Closes #587
❓ Type of change
📚 Description
Every
site / testrun 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.