title: How to mock a decorator function used on method that is used in SUT in JEST
body: <p>I have a typescript class:</p>
  
  <pre><code>export class SystemUnderTest {
  
    @LogThisAction('sth was done')
    public doSomething() {} 
  
  }
  </code></pre>
  
  <p>As you can see it uses a reflection to execute some decoration function:</p>
  
  <pre><code> export declare function LogThisAction(action: string): (target: any) =&gt; 
   void;
  </code></pre>
  
  <p>When I run test in I do not care about the actual impl. of this decorator function, so I try to mock it like this:</p>
  
  <pre><code> myModule = require(./DecoratorFunctions);
   myModule.LogThisAction = jest.fn();
  </code></pre>
  
  <p>But that does not seem to work. When I run tests I get:</p>
  
  <pre><code>● Test suite failed to run
  TypeError: decorator is not a function
  at DecorateProperty (node_modules/reflect-metadata/Reflect.js:553:33)
  </code></pre>
  
  <p>How to achieve my goal in JEST framework ?</p>