React Jest configuration with jsx and js | React testing library jest dom
React jest configuration with jsx and js | React testing library jest dom
Step 1 : Create React Project Using create-react-app
npx create-react-app jest-testing-library
Step 2 : Install React testing library dependencies
npm install --save-dev @testing-library/react @testing-library/jest-dom
ORyarn add --dev @testing-library/react @testing-library/jest-dom
Step 3 : Install Jest dependecies
npm install --save-dev jest jest-environment-jsdom
ORyarn add --dev jest jest-environment-jsdom
Step 4 : Configure Jest
Create a file named jest.config.js in the root folder and add the following code configuration.
Step 5 : Writing tests
Create One Component
Example.jsx
Create Test File
Example.test.jsx
Output
Tutorial Topics
- HTML5 Tutorial - What is HTML5
- HTML5 Tutorial - HTML5 Comment Tag in Hindi
- HTML5 Tutorial - What is Doctype in HTML5
- HTML5 Tutorial - a Tag in HTML5 in Hindi
- HTML5 Tutorial - abbr Tag in HTML in Hindi
- HTML5 Tutorial - address Tag in HTML in Hindi
- HTML5 Tutorial - area Tag in HTML in Hindi
- HTML5 Tutorial - article Element in HTML in Hindi
- HTML5 Tutorial - aside Tag in html in Hindi
- HTML5 Tutorial - audio Tag in HTML in Hindi
- HTML5 Tutorial - b Tag in HTML in Hindi
- HTML5 Tutorial - base Tag in HTML in Hindi
- HTML5 Tutorial - bdi Tag in html in Hindi
- HTML5 Tutorial - bdo Tag in html Example in Hindi HTML5 Tutorial - Blockquote Tag in HTML5 in Hindi