Skip to content

Commit

Permalink
add getServerSideProps test
Browse files Browse the repository at this point in the history
  • Loading branch information
schehata committed Jan 26, 2023
1 parent 4973079 commit 9814d8a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion __tests__/withAxiom.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger, withAxiom } from '../src/index';
import { withAxiomNextServerSidePropsHandler } from '../src/withAxiom';
import { NextApiRequest, NextApiResponse } from 'next';
import { GetServerSideProps, GetServerSidePropsContext, NextApiRequest, NextApiResponse } from 'next';
import 'whatwg-fetch';
import { NextFetchEvent, NextRequest, NextResponse } from 'next/server';

Expand Down Expand Up @@ -56,3 +56,15 @@ test('withAxiom(NextConfig) with fallback rewrites (regression test for #21)', a
});
if (config.rewrites) await config.rewrites();
});


test('withAxiom(GetServerSideProps)', async () => {
const getServerSideProps: GetServerSideProps = async (context: GetServerSidePropsContext) => {
return {
props: {},
};
};
const handler = withAxiomGetServerSideProps(getServerSideProps);
expect(handler).toBeInstanceOf(Function);
// TODO: Make sure we have a AxiomGetServerSideProps
});

0 comments on commit 9814d8a

Please sign in to comment.