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
Unable to get a running env with nuxt/test-utils
#15073
Comments
Here is an example: https://stackblitz.com/edit/github-jfeanw. |
With that repro I can't actually reproduce your error. If you're still experiencing it, would you provide a reproduction? 🙏 |
Thanks for getting back to me on this @danielroe! I just tested it out and it seems like the issue I was running into was due to colocating my tests within the |
Great. You may find that adding the test pattern to |
@danielroe Where exactly would you put that piece of config ? I'm having this issue when my spec file is in the edit: I found out it was in nuxt config, but actually I have this issue when I run the tests |
Same issue here. It may be caused by the wrong location of your test file just as @noook mentioned. To test SSR describe('index page', async () => {
await setup();
test('should has a title', async () => {
const htmlString = await $fetch('/');
console.log(htmlString);
});
}); Minimum issue reproduction: locate this file as How to fix: |
Environment
Though I have also tested with rc 10, 8, 5, & 4
Reproduction
This is fairly short so ill avoid reproduction unless theres a strong need
From a fresh Nuxt 3 Project:
Describe the bug
During the
beforeAll
section of thesetup
in my test it crashes with this result:This is strange since the runner is clearly
vitest
, so it shouldnt be trying to import jest.Took a brief look at the
index.mjs
and myhooks.ctx.options.runner
is properly recievingvitest
.The error ends with:
Additional context
I havent been able to find a solid working example to base my own code. I was hoping this issue was just the RC version that I was using, but so far I havent had any luck with changing it.
I tried cloning the
nuxt-ionic
repository as I saw it was on a later RC version and using vitest, however even with that I ran into issues. Is there a good working example I can be pointed in the direction of?Logs
The text was updated successfully, but these errors were encountered: