fix: load i18n in tests without typescript error #1167
Merged
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.
Contributor checklist
Description
This should fix the issue pointed out in #1166
Our frontend vitest tests broke recently because a configuration field "locales" was being overwritten causing a typescript error. This is happening because we have to reload i18n in vitest for our frontend tests to work.
There is an ongoing issue with
@nuxt/test-utils
that makes this necessary because the testing environment has multiple vue app instances in it and doesn't reference them in a consistent manner: nuxt-modules/i18n#2637This PR changes how i18n is initialized in vitest to get around the typescript error. This PR also adds the
--silent
flag to running the tests in CI to reduce the amount of Nuxt related warnings that probably need to be resolved in Nuxt itself.Related issue