[AstroDB] getViteConfig throws in Vitest - Cannot read properties of undefined (reading 'ASTRO_DATABASE_FILE') #11414
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
help wanted
Please help with this issue!
pkg: db
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
There's an error if I run vitest with astro's
getViteConfig
, and the default database.astro/content.db
is not seeded:Moreover, if I import the db in the test file (
import { db } from "astro:db"
) and set vitest'spoolOptions.threads.singleThread
to true, the test will fail half of the time.What's the expected result?
No error should be showing when running vitest. Test database should be seeded.
Link to Minimal Reproducible Example
https://github.com/haivuw/astrodb-vitest-repro
Participation
The text was updated successfully, but these errors were encountered: