Replies: 1 comment 1 reply
-
The same question, does anyone know how to solve it? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been following the guide to create a simple integration test with Vitest. The missing bit is the D1 integration, as it seems like the test environment doesn't have access to the local DB binding from wrangler.toml. Here is my setup:
All of this works perfectly fine when running the local worker with
npm run dev
, butnpm test
will throw the following error:Error: D1_ERROR: no such table: users: SQLITE_ERROR
Any ideas as to how to make Vitest access the local D1 database? is this possible? There is a recipe for executing a migration as part of the test, but ideally I'd like to run the integration test with the local db.
Beta Was this translation helpful? Give feedback.
All reactions