epic-stack icon indicating copy to clipboard operation
epic-stack copied to clipboard

Vitest fails after Prisma migration

Open andrecasal opened this issue 1 year ago • 1 comments

I migrated the DB to a simpler format.

Naturally, this got the testing database at ./tests/prisma/base.db out of sync with the Prisma client and most Vitest tests fail.

It would be nice if, everytime we run a migration, we also delete the test database so that Vitest setup re-runs the setup and copies ./prisma/data.db over to ./tests/prisma/base.db.

andrecasal avatar Mar 26 '24 09:03 andrecasal

Running migrations just takes a while so we cache it. We could add logic that checks the modified time of the schema to determine whether the database should be updated. Shouldn't be super complicated. PRs welcome!

kentcdodds avatar Mar 26 '24 13:03 kentcdodds