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

Neon image

Serverless Postgres in 300ms (❗️)

10 free databases with autoscaling, scale-to-zero, and read replicas. Start building without infrastructure headaches. No credit card needed.

Try for Free →

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

Neon image

Next.js applications: Set up a Neon project in seconds

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Get started →

👋 Kindness is contagious

Dive into this insightful write-up, celebrated within the collaborative DEV Community. Developers at any stage are invited to contribute and elevate our shared skills.

A simple "thank you" can boost someone’s spirits—leave your kudos in the comments!

On DEV, exchanging ideas fuels progress and deepens our connections. If this post helped you, a brief note of thanks goes a long way.

Okay