vitest bug #1844
Unanswered
silverbackdan
asked this question in
Help and Questions
vitest bug
#1844
Replies: 1 comment
-
See how to call the setup here. It creates the hooks for you: Should be simple enough to get your tests working :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Reproduction
There is a fixme comment
Steps to reproduce the bug
Run the vitest
Expected behavior
Passing
Actual behavior
Failing I believe
Additional information
I think the
await setup
function cannot be in thebeforeAll
hook and should be just withindescribe
My tests also seem to fail unless it is within
describe
which is how it is listed in the Nuxt 3 Module Author Guidehttps://github.com/vuejs/pinia/blob/v2/packages/nuxt/__tests__/nuxt.spec.ts
So would look like this - it's just a punt on the issue, but perhaps worth a try. Thanks for a great storage solution.
Reference: https://nuxt.com/docs/guide/going-further/modules#tests-setup
Edit: although, in
beforeAll
I can get my tests working with just addingawait loadFixture()
-await startServer()
seems to fail... interesting.But either way, outside of the
beforeAll
the server is started successfully and you can run the$fetch
within tests.Beta Was this translation helpful? Give feedback.
All reactions