How to test Nuxt server routes that uses Cloudflare d1 and OAuth2? #1021
Unanswered
arunanshub
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been working on a Nuxt project that integrates SQLite with Cloudflare D1 as the backend database, following the testing guidelines from the Nuxt Testing and Nuxthub documentation.
I've managed to run the tests successfully, but only when using
setup({ dev: true })
. This configuration forces the test environment to use the local development database stored in the.data/
directory (which is created by NuxtHub). This isn't the behavior I'm looking for. Furthermore, I'm encountering significant challenges:registerEndpoint
)Can anyone provide guidance on resolving this issue?
Check out the MCVE project at https://stackblitz.com/edit/nuxt-d1-testing?file=tests%2Fbasic.test.ts. Run tests with
pnpm vitest
.Beta Was this translation helpful? Give feedback.
All reactions