DEV Community

Neha Sharma
Neha Sharma

Posted on β€’ Edited on

9

Your Guide for Testing ReactJS Apps - Part 1

What is Testing

Testing is crucial for the engineers and every engineering team. Testing helps in gaining the confidence on the features devs are developing, and shipping. Gone are the days where we used to relay only on the testers for the testing and bugs.

Now, engineers are encouraged to write test-cases to avoid bugs and errors. This will increase the confidence of the developers in the product and shipping the code with quality.

Type of testing (React) & complexity

  1. Unit testing: Easy

  2. Snapshot : Easy and for UI

  3. Integration Testing: Medium

  4. End to end testing: Complex

Image description

Type of testing:

  1. TDD: Test driven development

  2. BDD: Behaviour driven development

Why testing

  1. Avoid bugs

  2. Gain confidence

  3. Proof of documentation

  4. Quality code

Library for test cases

There are 2 testing way: Assertion & test runner

  1. Jest

  2. Chai

  3. Mocha

  4. React Testing Library

  5. Puppeteer

  6. Playwright

  7. Airbnb

Autonomy of test case

Image description

Details

Image description

In next, blog we will get into the code. We will write our first test-case.

If you like this blog do follow me at Twitter

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (3)

Collapse
 
asadanik profile image
Asad Anik β€’

Thanks a Lot Neha πŸ₯°πŸ₯°πŸ’–πŸ’πŸ»πŸ’πŸ»

Collapse
 
rajat05 profile image
Rajat β€’

Thank you for this Neha. Looking forward to this testing series. :D

Collapse
 
hellonehha profile image
Neha Sharma β€’

Yes, 2nd is in draft and will be going live soon

The best way to debug slow web pages cover image

The best way to debug slow web pages

Tools like Page Speed Insights and Google Lighthouse are great for providing advice for front end performance issues. But what these tools can’t do, is evaluate performance across your entire stack of distributed services and applications.

Watch video