Skip to content
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

fix: load i18n in tests without typescript error #1167

Merged
merged 2 commits into from
Mar 19, 2025

Conversation

cquinn540
Copy link
Collaborator

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#2637

This 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

  • #ISSUE_NUMBER

Copy link

netlify bot commented Mar 18, 2025

Deploy Preview for activist-org ready!

Name Link
🔨 Latest commit b999791
🔍 Latest deploy log https://app.netlify.com/sites/activist-org/deploys/67d9adb0c871930008140a4b
😎 Deploy Preview https://deploy-preview-1167--activist-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

Thank you for the pull request! ❤️

The activist team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Development rooms once you're in. Also consider attending our bi-weekly Saturday developer syncs! It'd be great to meet you 😊

Copy link
Contributor

github-actions bot commented Mar 18, 2025

Maintainer Checklist

The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

  • The TypeScript, pytest and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The Playwright end to end and Zap penetration tests have been ran and are passing (if necessary)

  • The changelog has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this, @cquinn540! Really appreciate the quick fix :)

@andrewtavis andrewtavis merged commit 2b26bd0 into activist-org:main Mar 19, 2025
7 checks passed
@cquinn540 cquinn540 deleted the fix-frontend-tests branch March 19, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants