Created
July 31, 2022 09:03
-
-
Save jamal-abbasi/2c1ae0433256449de13efb3585268aea to your computer and use it in GitHub Desktop.
Unit Testing React Application Sample Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { render } from '@testing-library/react'; | |
import App from './App'; | |
test('renders react link', () => { | |
const { getByText } = render(<App />); | |
const linkElement = getByText(/learn react/i); | |
expect(linkElement).toBeInTheDocument(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment