You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set up my schema using typeorm. (db.adapters.createTypeormDataSource()... syncrhonize()
create a db backup. db.backup();
put this all in a static class
for each test requiring a DataSource, I would call a method from this static class creating a new DataSource pointing to the snapshot version of the database.
The problem is, db.backup() doesn't produce a new version of the database, it creates a snapshot point I have no access to.
I need something like:
var copyOfDb = db.backup();
newDataSource = await copyOfDb.adapters.createTypeormDataSource({...})
Any other way to achieve this?
The text was updated successfully, but these errors were encountered:
Hmm... I guess this is not possible, right?
If I got it right, Jest will run tests of different files in parallel each in its own process not sharing state between them.
This means my static context won't be shared and the best I will get is one instance of the DB per file anyway.
Would that be a correct assumption?
The idea is:
The problem is, db.backup() doesn't produce a new version of the database, it creates a snapshot point I have no access to.
I need something like:
Any other way to achieve this?
The text was updated successfully, but these errors were encountered: