-
-
Notifications
You must be signed in to change notification settings - Fork 578
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
Update Vitest to 1.6.0
#1861
Update Vitest to 1.6.0
#1861
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Amazingly thorough investigation and documentation of the fix @HiDeoo! This all makes sense to me and I’m happy to go with this approach as you suggested.
One question: do you think it makes most sense to merge this into the MDX v3 branch or is it better to target main
and then I can rebase the MDX v3 branch on top of these changes?
I initially targeted the MDX v3 branch as it's the one that needed the Vitest update (due to Vite 5.1 changes with the Astro bump) but technically, I guess this could also makes sense to target |
Let's target |
This should be good, also pushed an empty commits to re-run all the workflows as I think there is still no event so that the workflows can be triggered after the base branch change. |
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.
LGTM! Thanks for cleaning that up @HiDeoo 🚀
This PR is targetting #1846.Description
This PR updates the Vitest version used in the monorepo to the latest version instead of the initial
1.4.0
bump due to a test failure.Why was this test failing when upgrading to at least Vitest
1.5.0
?1.5.0
introduced a change to the workspace feature current working directory (cwd
) making it the config directory.1.4.0
, the current working directory would bepackages/starlight/
1.5.0
, the current working directory would bepackages/starlight/__tests__/i18n-non-root-single-locale/
for thei18n-non-root-single-locale
test suite.getViteConfig()
which will internally callresolveConfig()
which callsresolveRoot()
with anundefined
argument which would end up usingprocess.cwd()
.packages/starlight/__tests__/i18n-non-root-single-locale/
as the root,packages/starlight/__tests__/i18n-non-root-single-locale/src/content/i18n/fr.json
would be automatically loaded when we callgetCollection()
which was not the case before.Why is only the
i18n-non-root-single-locale
test suite failing and not thei18n
test suite which uses a similar setup?i18n
test suite is not impacted because the default locale isen
but is configured with alang
using a regional subtag (en-US
) which means the user config overrides needs to be in foren-US
and thus not being impacted byen.json
being loaded.How is this PR fixing the issue?
i18n-non-root-single-locale
test suite to use thefr-CA
for thelang
of the default locale to use the same setup as thei18n
test suite.What alternatives were considered?
getViteConfig()
new second argument to specify theroot
in the inline Astro config to fallback to the previous behavior and avoid usingprocess.cwd()
but I think this is wrong to just assume the CWD is not the root of the test suite.packages/starlight/__tests__/i18n-non-root-single-locale/translations-fs.test.ts
to another dedicated suite (where we do not mix real CC files and CC mocking). I think this is a valid one but we would need I think to do the same for thei18n
test suite which is not failing. I think it's better to have a consistent setup for all the test suites but I'm open to feedback on this.Why are the
.gitignore
changes in this PR required?By Astro now using the proper root, and
getViteConfig()
somehow triggering someting close toastro sync
, we end up with all the extra files in each test suites instead of justpackages/starlight/
like before when this folder was considered the CWD.