title: How to mock Typescript enums without violating type contract
body: <p>I'm trying to unit test a function which accepts an Enum parameter type, for example a function like this.</p>
  
  <pre><code>function consumeEnumValue(value: MyEnumType) {
      //do something
  }
  </code></pre>
  
  <p>But I don't want to import the real Enum into my test code, I want to use a mocked Enum with fictional entries.  The following doesn't work:</p>
  
  <pre><code>import { consumeEnumValue } from 'production-code.ts'
  
  enum FictionalEnum {
      foo,
      bar,
  }
  
  describe('consumeEnumValue', () =&gt; {
      it('should run and have no type errors', () =&gt; {
          expect(consumeEnumValue(FictionalEnum.foo)).toEqual(/* something */);
      });
  });
  </code></pre>
  
  <p>Of course typescript complains that the argument type and the parameter type don't match.</p>
  
  <p>Is there a way to mock an enum with fictional values?</p>