Skip to content

Rollback database in e2e tests #1843

@grigori-gru

Description

@grigori-gru

I'm submitting a...


[ ] Regression 
[ ] Bug report
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

All database should be cleaned, reloaded and seed before each e2e test. If have many tests you spend too much time.

Expected behavior

Each test with database is never committed, all data becomes as initial after each. Database creates and seed only ones before all tests.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Some other frameworks have good practice to roll back all DB transactions inside test case after each test is finished. It lets you not to spend too much time for clean and reload all your DB and seed testing fixtures. You just load your test database, seed data before all tests and clean it after finish optionally but all your tests are independent and have the same environment.
I can't find it in docs or issues, even DB transactions at least. Maybe you have something for Typeorm?

Environment


Nest version: 6.0.0

 
Others:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions