title: <spyOn> : <functionName> is not declared writable or has no setter
body: <p>I am trying spy an exported function with jasmine and angular. I am importing that function into my test file with the pattern: <code>import * as HelperObject from '../file-parse'</code> to have an object to spy on and then specify its exported function to create the spy. So, I have</p>
  
  <p><code>file-to-test.spec.ts</code></p>
  
  <pre><code>import * as ParseHelper from './file-parser';
  
  describe('ParserWorker', () =&gt; {
      it('should do something', () =&gt; {
         const mockResponse: CustomType = new CustomType()
         const spy = spyOn(ParseHelper, 'parser').and.returnValue(mockResponse)
      })
  })
  </code></pre>
  
  <p>In <code>file-parser.ts</code> file I have this exported function</p>
  
  <pre><code>export function parser(fl: File, hd: boolean = false): CustomType{
      ... do something
  
      return CustomTypeObject;
  }
  </code></pre>
  
  <p>When I run this test Karma show me this error:</p>
  
  <p><code>Error: &lt;spyOn&gt; : parser is not declared writable or has no setter</code></p>
  
  <p>I used this way to spy an individual exported function with no problem, notice that those functions are not any angular components or services, it just a class helper that has some functions that I need to pass to a web worker.</p>