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

Better story for testing with lazy-loaded translations config #1705

Open
runspired opened this issue Jul 13, 2022 · 5 comments
Open

Better story for testing with lazy-loaded translations config #1705

runspired opened this issue Jul 13, 2022 · 5 comments

Comments

@runspired
Copy link

Currently for every test you must set the locale and await the fetch and add the translations, would be great to be able to do this more easily.

@CarlosLazarini
Copy link

I second this. I'm trying to change my app to work with lazy loading translations and I'd need to change thousands of tests.

@runspired
Copy link
Author

I can post our setup later, you can do a global test setup. Not terribly hard, just a guide for it would be good.

@CarlosLazarini
Copy link

@runspired that would be great, appreciate it 🙌

@jahrock
Copy link
Contributor

jahrock commented Jul 12, 2023

@runspired would be interested in your reference implementation.

In our scenario, we don't use the intl service directly, as we have created a middle layer translation service that interacts with the intl service on it's own.

For this reason, I disabled lazy loading during the execution of our tests in the first step: publicOnly: environment !== 'test',

This eliminates the need to manually load the translations in each test, but the language still needs to be set.

@runspired
Copy link
Author

described our setup mostly here #1659 (comment)

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

No branches or pull requests

3 participants