diff --git a/__tests__/testing-library.tsx b/__tests__/testing-library.tsx deleted file mode 100644 index fc1b766..0000000 --- a/__tests__/testing-library.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -import { render } from "@testing-library/react"; -import Index from "../pages/index"; - -test("renders deploy link", () => { - const { getByText } = render(); - const linkElement = getByText(/Instantly deploy your Next\.js site to a public URL with Vercel\./); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/pages/api/hello.ts b/pages/api/hello.ts index 4ec6e33..0d352b0 100644 --- a/pages/api/hello.ts +++ b/pages/api/hello.ts @@ -1,6 +1,14 @@ import { NextApiRequest, NextApiResponse } from "next"; // Next.js API route support: https://nextjs.org/docs/api-routes/introduction +export interface HelloResponseType { + name: string; +} + +export const helloResponse = (): HelloResponseType => { + return { name: "John Doe" }; +}; + export default (req: NextApiRequest, res: NextApiResponse) => { - res.status(200).json({ name: "John Doe" }); + res.status(200).json(helloResponse()); };