Open haivuw opened 3 months ago
This is what it shows in my private project:
FAIL src/auth/verify-email.test.ts [ src/auth/verify-email.test.ts ]
TypeError: Cannot read properties of undefined (reading 'ASTRO_DATABASE_FILE')
❯ eval astro:db:seed:7:87
❯ instantiateModule node_modules/.pnpm/vite@5.3.3_@types+node@20.14.9/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:53451:5
If I run ASTRO_DATABASE_FILE=test.db pnpm exec vitest run
, test.db
is created as expected, but it won't be seeded, and I still see the error.
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