diff --git a/template/src/App.test.tsx b/template/src/App.test.tsx new file mode 100644 index 0000000..86da92e --- /dev/null +++ b/template/src/App.test.tsx @@ -0,0 +1,9 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; +import App from "./App"; + +test("renders learn react link", () => { + render(); + const linkElement = screen.getByText(/learn react/i); + expect(linkElement).toBeInTheDocument(); +}); diff --git a/template/src/setupTests.ts b/template/src/setupTests.ts new file mode 100644 index 0000000..1dd407a --- /dev/null +++ b/template/src/setupTests.ts @@ -0,0 +1,5 @@ +// jest-dom adds custom jest matchers for asserting on DOM nodes. +// allows you to do things like: +// expect(element).toHaveTextContent(/react/i) +// learn more: https://github.com/testing-library/jest-dom +import "@testing-library/jest-dom";