epicweb-dev / epicweb-dev/epic-stack

How to use a different `*.db` file during e2e tests?

Open
#1,061 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.5k
Forks
460
Avg merge
2h 43m
Merged PRs (30d)
1

Description

Hi!

I think we should use a different SQLite database instance for e2e testing. That is to separate whatever state the local database has during development. Basically, each test run should start with a clean database (and likely even drop the db between test suites/cases as well) to ensure proper test isolation.

I've tried setting `DATABASE_URL` to `file:./data.db?` in here:

https://github.com/epicweb-dev/epic-stack/blob/97135fcd7899cab299b402f36804b0d169e87d9d/playwright.config.ts#L37-L40

> I've also tried `DATABASE_PATH: './prisma/test.db'` to no effect.

But that had no effect on the app under test; it still used `./prisma/data.db`. I might be doing something wrong here... Any hints would be appreciated!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.