typeorm / typescript-express-example

Example how to use Express and TypeORM with TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is the best way to test this?

Kogs opened this issue · comments

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^

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.