-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: improve testing component examples #27138
Conversation
Run & review this pull request in StackBlitz Codeflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great - just need to confirm it will pass twoslash type testing - it might need some more basic comments.
Also (tiny thing) we generally prefer the tilde alias in the docs.
docs/1.getting-started/11.testing.md
Outdated
// ---cut--- | ||
// tests/components/SomeComponents.nuxt.spec.ts | ||
import { mountSuspended } from '@nuxt/test-utils/runtime' | ||
import App from '@/app.vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import App from '@/app.vue' | |
import App from '~/app.vue' |
docs/1.getting-started/11.testing.md
Outdated
// ---cut--- | ||
// tests/App.nuxt.spec.ts | ||
import { renderSuspended } from '@nuxt/test-utils/runtime' | ||
import App from '@/app.vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import App from '@/app.vue' | |
import App from '~/app.vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - I updated the @s to ~s and gave it a conventional commit message and force pushed (which now that I have properly read the contribution docs I am thinking might not have been necessary since it'll use the PR title).
Anyhow, hopefully all good now. Thanks for your help. A nice smooth process :)
Thank you ❤️ |
🔗 Linked issue
Resolves #27120.
Thanks @danielroe for the pointer on the import shortcut.
I made a PR with some related tweaks - hopefully improvements.
import App from '@/app.vue'
) but maybe there is another way?