diff --git a/src/pages/[...hash].tsx b/src/pages/[...hash].tsx index 54466bb6..5f34b5a3 100644 --- a/src/pages/[...hash].tsx +++ b/src/pages/[...hash].tsx @@ -141,7 +141,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { userAgent: context.req.headers['user-agent'], ip, }); - if (!forwardUrl.history) throw 'Cannot found history to forward'; + if (!forwardUrl.history) throw new Error('Cannot found history to forward'); return { props: { history: forwardUrl.history, diff --git a/src/test/forward.test.ts b/src/test/forward.test.ts index 9e2d9406..08cc0dce 100644 --- a/src/test/forward.test.ts +++ b/src/test/forward.test.ts @@ -83,7 +83,6 @@ describe('Test /api/forward...', () => { await handler(req2, res2); expect(res2._getStatusCode()).toBe(HttpStatusCode.OK); const history2: UrlShortenerHistory = JSON.parse(res2._getData()).history; - console.log('history2', history2); expect(history2.url).toEqual(history1.url); }); });