odavid / typeorm-transactional-cls-hooked

A Transactional Method Decorator for typeorm that uses cls-hooked to handle and propagate transactions between different repositories and service methods. Inpired by Spring Trasnactional Annotation and Sequelize CLS
MIT License
522 stars 86 forks source link

Add unit test mocking information to readme #81

Closed nathan815 closed 3 years ago

nathan815 commented 3 years ago

First off thanks a lot for this package! I was frustrated with the way transactions work in typeorm having to pass an EntityManager around so this is super helpful 😄

This PR adds unit testing info and a mock for Jest (found in #2). Figured this would be useful for anyone else trying to run @Transactional functions in unit tests that don't touch the database.

odavid commented 3 years ago

Thank you @nathan815 !