ParaglideJS: How to use it in test frameworks ? #2035
Answered
by
LorisSigrist
LBF38
asked this question in
[inlang SDK] General
-
Hi Opral's team, I'm using ParaglideJS in a new SvelteKit app I'm starting and I'm struggling on using messages in test frameworks, especially in Playwright e2e testing. Thanks in advance for your help ! |
Beta Was this translation helpful? Give feedback.
Answered by
LorisSigrist
Jan 17, 2024
Replies: 1 comment 4 replies
-
We don't have any guides on testing yet. Can I ask, what is making it difficult to test?
We are avid testers ourselves, so making sure it's easy to test with Paraglide is very important to us |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Likely the import alias
$paraglide
isn't set up to work in test-files. try importing fromsrc/paraglide/messages.js
instead.Also keep in mind that the test-browser and the Playwright test run in different processes, so the language will not automatically be shared between them. I would recommend always explicitly setting the language for messages that are used in a test.
Try