title: How to Test Next.js's getServerSideProps with jest
body: <p>I would like to run tests with Jest and Enzyme on Next.js's  <code>getServerSideProps</code> function. The function looks like the following:</p>
  <pre><code>export const getServerSideProps: GetServerSideProps = async (context) =&gt; {
    const id = context?.params?.id;
    const businessName = getBusinessName(id);
    return {
      props: {
        businessName: response.data?.name,
        businessID: id,
      },
    };
  };
  </code></pre>
  <p>However since I'm using the <code>context</code> parameter in my function I need to pass a context into my test. My test right now looks like:</p>
  <pre><code>it(&quot;check on good case&quot;, () =&gt; {
      const value = getServerSideProps(/*I'm not sure what to put here*/);
      expect(value).toEqual({props: {businessName: &quot;Name&quot;, businessID: &quot;fjdks&quot;}})
    });
  </code></pre>
  <p>My question is what do I pass into the parameter for context. I know it needs to be of type: <code>GetServerSidePropsContext&lt;ParsedUrlQuery&gt;</code>. But I'm not sure how to create that type. What can I pass into the function that also allows me to add an <code>id</code> value in the params as well?</p>