title: TypeError when trying to refactor
body: <p>I'm trying to refactor a test,
  and I can't figure out what I'm doing wrong.</p>
  <p>So, trying to refactor from this example :</p>
  <p>Test.ts</p>
  <pre><code>import MailosaurClient from &quot;mailosaur&quot;;
  import { Selector, t } from &quot;testcafe&quot;;
  const testUrl = `https://www.google.com/`;
  fixture(&quot;fixture&quot;)
    .page(&quot;https://www.google.com/&quot;)
    .beforeEach(async (t) =&gt; {
      console.log(&quot;test&quot;);
    })
  
  test(&quot;Test&quot;, async (t) =&gt; {
    console.log(&quot;Starting test&quot;);
       await t.expect(getUrl()).eql(url);
  }
  
  </code></pre>
  <p>to this:</p>
  <p>MainApp.ts</p>
  <pre><code>const getUrl = ClientFunction(() =&gt; window.location.href);
  export class MainApp {
    async login(url:string) {
      await t.expect(getUrl()).eql(url);
    }} 
  </code></pre>
  <p>Test.ts</p>
  <pre><code>import MailosaurClient from &quot;mailosaur&quot;;
  import { Selector, t } from &quot;testcafe&quot;;
  import {MainApp} from &quot;./MainApp&quot;;
  const testUrl = `https://www.google.com/`;
  fixture(&quot;fixture&quot;)
    .page(&quot;https://www.google.com/&quot;)
    .beforeEach(async (t) =&gt; {
      console.log(&quot;test&quot;);
    })
  const mainApp = new MainApp();
  test(&quot;Test&quot;, async (t) =&gt; {
    console.log(&quot;Starting test&quot;);
    await MainApp.login(
      testUrl
    ); }
  </code></pre>
  <p>but unexpectedly this error occurs :</p>
  <p>&quot;Cannot prepare tests due to the following error:</p>
  <p>TypeError: MainApp_1.MainApp is not a constructor&quot;</p>