-
Notifications
You must be signed in to change notification settings - Fork 520
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
test: add initial component tests #923
Conversation
# Conflicts: # pnpm-lock.yaml
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
Have you seen the |
Yes, I saw them. It is because color-mode tries to access a property inside |
Do you want to merge this as is? |
I tried to inject to the window, but in vain. It should be possible to do through globalThis. Maybe let's merge like this and fix that error later. |
Yes, we need to fix this in color mode module. Here's a patch I made in my own website to handle a different issue with server components: https://github.com/danielroe/roe.dev/blob/main/patches/%40nuxtjs__color-mode%403.3.0.patch But we need a PR to the module, which I'll do (or someone else if you get to it first). |
Thanks @danielroe! Seems the latest version of |
@jrutila There is still a warn remaining: |
It comes from a recent pr to Nuxt vitest that we need to look at. But it's safe. |
I have a last question, unlike what's mentioned on the README, this PR does not register the |
What do you mean? At least there is |
π Linked issue
#546
β Type of change
π Description
Adds component unit tests using
nuxt-vitest
. There is a generalcomponent-render
function that can be used to render the function. The rendered outcome is saved to the vitest snapshots, which is a quite nice way to do it in this kind of module to prevent accidental changes. You can either give the options for the component in code or write direct HTML.One future development idea is to source the docs for component examples and use those as additional test cases as we only need the HTML of the component.
π Checklist