Closed Kogs closed 6 years ago
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.
I'm wondering how to write tests for this kind of express/typorm project setup.
How to mock the Repositories?
Any ideas/recommendations?