TypeORM - How to create temporary tables for testing

Viewed 526

I am using TypeORM in my backend NodeJS projects. I now want to introduce testing into my projects. In order to get robust testing I want the tests to be run on an actual database. I first thought to use a simple in memory SQLite DB. But I ran into problems with compatibility on column types with the actual PostgreSQL data types.

So then after searching online I have found some cases where people were creating temporary tables when testing. These tables would be created at the start of testing and deleted afterwards.

But I could not find any way how to accomplish this with TypeORM. Is there a way to build and create temporary tables inside the project db?

0 Answers
Related