From 84566ab1a54618705ad4ede59ddeb2ccb60d34a7 Mon Sep 17 00:00:00 2001 From: Juan Diaz Date: Thu, 26 Oct 2023 11:29:34 -0400 Subject: [PATCH] [add] testing files --- src/App.test.js | 8 ++++++++ src/setupTests.js | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 src/App.test.js create mode 100644 src/setupTests.js diff --git a/src/App.test.js b/src/App.test.js new file mode 100644 index 0000000..1f03afe --- /dev/null +++ b/src/App.test.js @@ -0,0 +1,8 @@ +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/src/setupTests.js b/src/setupTests.js new file mode 100644 index 0000000..8f2609b --- /dev/null +++ b/src/setupTests.js @@ -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';