We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove enzyme and use react-testing-library instead.
enzyme
yarn add @testing-library/react @testing-library/react-hooks @testing-library/jest-dom -D
// Example.tsx import React from 'react' export const Example = () => { return <div data-testid="example">Example</div> }
// Example.test.tsx import React from 'react' import { render, screen } from '@testing-library/react' import { Example } from '..' describe('Example', () => { it('should render', () => { render(<Example />) expect(screen.getByTestId('example')).toBeInTheDocument() }) })
// jest.setup.ts // @see https://www.carlrippon.com/using-jest-and-rtl-with-react-typescript/ import '@testing-library/jest-dom'
These days I prefer using RTL instead of Enzyme because its implementation and syntax feels more natural and "react"-like than enzymes.
The text was updated successfully, but these errors were encountered:
natterstefan
No branches or pull requests
Feature Request
Remove
enzyme
and use react-testing-library instead.Tasks
Example
Motivation
These days I prefer using RTL instead of Enzyme because its implementation and syntax feels more natural and "react"-like than enzymes.
The text was updated successfully, but these errors were encountered: