Hello. I'm using transactions in my app and in one case I'm passing transactionalEntityManager as an argument to another method form other service than the one I use DataSource in. As an example:
await myDataSource.transaction(async (transactionalEntityManager) => { // execute queries using transactionalEntityManager in the current service // and also passin as an argument the manager and callin a method from other service await this.anotherInjectedService.doDataBaseAction(transactionalEntityManager, someId, someData) })
So the problem occurs when I want to test that anotherInjectedService's method doDataBaseAction and don't get the idea of how can I mock the transactionalEntityManager in that test. I'm using jest by the way and mentioning unit tests.