Aliheym / typeorm-transactional

A Transactional Method Decorator for TypeORM that uses Async Local Storage or cls-hooked to handle and propagate transactions between different repositories and service methods.
MIT License
213 stars 28 forks source link

Mocking @Transactional with Mocha test suite #48

Open chiarag opened 9 months ago

chiarag commented 9 months ago

While I see that there is a nice way to mock @Transactional (and other functions) with Jest, we have a large code base using Mocha. So switching over to Jest is pretty problematic.

Has anyone successfully stubbed the decorator with sinon and mocha? I'm poking around proxyquire but this is a TypeScript code base and it doesn't seem as though there is much documentation for how you use proxyquire with TypeScript.