title: next-i18next unit testing error 'Cannot read property language of undefined' with Link and jest
body: <p><code>next-i18next</code> uses it's own <code>Link</code> component to be compatible with locale sub-paths.</p>
  <p><a href="https://github.com/isaachinman/next-i18next" rel="nofollow noreferrer">https://github.com/isaachinman/next-i18next</a></p>
  <p>When I try a simple snapshot test I get the error <code>Cannot read property language of undefined</code>.</p>
  <p>My component:</p>
  <pre><code>import React from 'react';
  import { TFunction } from 'next-i18next';
  import { withTranslation, Link } from '../../../i18n';
  
  interface HeaderProps {
    readonly t: TFunction;
  }
  
  const Header = ({ t }: HeaderProps): JSX.Element =&gt; {
    return (
      &lt;&gt;
        &lt;Flex&gt;
          &lt;Box&gt;
            &lt;Link href=&quot;/&quot;&gt;{t('home')}&lt;/Link&gt;
          &lt;/Box&gt;
        &lt;/Flex&gt;
      &lt;/&gt;
    );
  };
  
  export default withTranslation('common')(Header);
  </code></pre>
  <p>It's snapshot test:</p>
  <pre><code>import React from 'react';
  import { render, screen } from '@testing-library/react';
  import Header from './Header';
  
  describe('&lt;Header/&gt;', () =&gt; {
    test('it should render correctly', () =&gt; {
      const { container } = render(&lt;Header /&gt;);
      expect(container.firstChild).toMatchSnapshot();
    });
  });
  </code></pre>
  <p>The test runs and passes without the <code>Link</code> component as expected.</p>
  <p>I have defined my <code>i18n.ts</code> as follows:</p>
  <pre><code>import path from 'path';
  import NextI18Next from 'next-i18next';
  import { publicRuntimeConfig } from './next.config';
  
  const { localeSubpaths } = publicRuntimeConfig;
  
  export const nextI18next = new NextI18Next({
    browserLanguageDetection: false,
    defaultNS: 'common',
    defaultLanguage: 'en',
    fallbackLng: 'en',
    otherLanguages: ['fr'],
    localeSubpaths,
    localePath: path.resolve('./public/static/locales'),
  });
  
  export const {
    i18n,
    appWithTranslation,
    Link,
    withTranslation,
    Router,
  } = nextI18next;
  </code></pre>
  <p>Is there anyway I can fix this error?</p>