Skip to content

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

@kettanaito

Description

@kettanaito

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:

env: {
PORT,
NODE_ENV: 'test',
},

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions