title: How to write unit-tests for method with @Transaction() decorator?
body: <p>I have a service on NestJS 6. I use TypeORM for work with MySQL.</p>
  
  <p>When I try to write unit-tests for method with <code>@Transaction()</code> and <code>@TransactionManager()</code> decorators, I get the error: <code>ConnectionNotFoundError: Connection "default" was not found.</code>.</p>
  
  <pre><code>@Put(':id')
  @Transaction()
  update(
    @Body() someData: SomeDto,
    @Param('id') id: number,
    @UserDecorator() user: User,
    @TransactionManager() manager: EntityManager,
  ) {
    return this.someService.update(id, someData, user, manager);
  }
  </code></pre>
  
  <p>My test:</p>
  
  <pre><code>beforeEach(async () =&gt; {
    manager = new EntityManager(null);
    someService = new SomeService();
    someController = new SomeController(someService);
  });
  
  describe('update', () =&gt; {
    it('should update', async () =&gt; {
      jest.spyOn(someService, 'update').mockResolvedValue(result);
  
      await expect(await someController.update(someData, 1, user, manager)).toBe(result);
      expect(someService.update).toBeCalledWith(1, someDto, user, manager);
    });
  });
  </code></pre>
  
  <p>Is there a better way for write and test it?</p>