typeorm/typescript-express-example

What is the best way to test this?

Kogs opened this issue · 2 comments

Kogs commented

I'm wondering how to write tests for this kind of express/typorm project setup.

How to mock the Repositories?

Any ideas/recommendations?

good question^

Kogs commented

It's not testable like that. What I did was writing 'business objects' that use internally TypeOrm Repositories. This BO classes then can get mocked so there is no database connection required.