title: Jest react keycloak client instance is not defined error
body: <p>In my react application I have a function which is using keycloak instance like in code below</p>
  <pre class="lang-js prettyprint-override"><code>function fetchUrlWithAuthentication(url) {
    const headers = new Headers();
    headers.set('Authorization', `Bearer ${keycloakClient.token}`);
    return fetch(url, {
      headers,
    });
  }
  </code></pre>
  <p>in Jest file i'm getting error:  <code>keycloakClient is not defined</code></p>
  <p>I tried to define in <code>beforeEach</code> keycloak instance but it didnt help, any suggestions how to fix this error ?</p>
  <pre class="lang-js prettyprint-override"><code>  beforeEach(() =&gt; {
      const keycloakClient = Keycloak({
        url: 'https://www.test.de/auth',
        realm: 'realm',
        clientId: 'clientId',
      });
      originalOpen = window.open;
      window.open = jest.fn().mockName('window.open');
    });
  </code></pre>