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
Nuxt I18N and switchLocalePath elements break the test #2529
Comments
I'm not familiar with the technologies you're using here. Best I can tell this is not an AVA issue. AVA being a Node.js test runner you need to get a little creative in faking browser environments. I can see some dependencies meant to help with that but you did not share your AVA configuration. (I'm closing this issue for housekeeping purposes, but let's keep the conversation going.) |
Hey I had the exact same problem and just managed to fix it. The problem is that the nuxt instance that you are referencing does not have the nuxt-i18n module set up. For you to fix it and also taking into account that it would happen with other modules. You just have to add it to the nuxt configuration in the module property before building it. Like this: const config = {
dev: false,
rootDir: resolve(__dirname, '../../'),
modules: [
'nuxt-i18n'
]
}
nuxt = new Nuxt(config) |
Hello thx a lot. But the nuxt-i18 lib is already in my modules configuration in nuxt.config.json.
|
Keep in mind that you are creating a new instance of Nuxt while you are doing your e2e tests, so that means that your nuxt.config.json is not being referenced at all. Thats why on the config hash while building your new Nuxt instance you have to reference the module for it to take it into account. |
Hello.
What you're trying to do
Launch test on the root page who have some I18N elements and a switchLocalePath in my code.
What happened
AVA test display this error :
Error for i18N with this {{ $t('www_downloads_brochure') }} code :
Error for switchLocalePath with this code :
That the test pass
We'll also need your AVA configuration (in
package.json
orava.config.*
configuration files) and how you're invoking AVA. Share the installed AVA version (get it by runningnpx ava --version
).The text was updated successfully, but these errors were encountered: