---
title: "Discussion on \"How to write fewer tests but find more bugs in your React components\" | Hashnode"
description: "Discussion on \"How to write fewer tests but find more bugs in your React components\". How in general should I know what to test?\n\nWhenever we're deciding how to test a component, the main challenge is choosing which tests to write. That's because even a simple function like add(a: number, b: number) has a potentially infinite number o..."
url: "https://hashnode.com/posts/how-to-write-fewer-tests-but-find-more-bugs-in-your-react-components/614794c5699fe76cd34833e1"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to write fewer tests but find more bugs in your React components](https://jnforja.hashnode.dev/how-to-write-fewer-tests-but-find-more-bugs-in-your-react-components?utm_source=hashnode&utm_medium=feed)

How in general should I know what to test? Whenever we're deciding how to test a component, the main challenge is choosing which tests to write. That's because even a simple function like add(a: number, b: number) has a potentially infinite number o...

Sep 19, 2021 · 7 min read · jnforja.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#testing](https://hashnode.com/tag/testing)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[João Forja](https://hashnode.com/@jnforja)

@jnforja

  
[View profile](https://hashnode.com/@jnforja)

Senior Fronted Engineer

## Responses 3

Markdown supported · ⌘↵ to post

[Ankur Tyagi](https://hashnode.com/@TheAnkurTyagi)

[Sep 21, 2021](https://hashnode.com/posts/how-to-write-fewer-tests-but-find-more-bugs-in-your-react-components/614794c5699fe76cd34833e1/comment/6149809f699fe76cd3485aa6)

This is quite a awesome stuff [João Forja](https://hashnode.com/@jnforja)

[Matej](https://hashnode.com/@konradmatej)

[Sep 20, 2021](https://hashnode.com/posts/how-to-write-fewer-tests-but-find-more-bugs-in-your-react-components/614794c5699fe76cd34833e1/comment/6148f87e699fe76cd34852a6)

I never knew you could use `each` for creating scenarios and it iterates over that! Super useful, thanks for this!

[THETA INDOMARGA](https://hashnode.com/@ROPINUSGINTING)

[Sep 20, 2021](https://hashnode.com/posts/how-to-write-fewer-tests-but-find-more-bugs-in-your-react-components/614794c5699fe76cd34833e1/comment/6148875217da986cea647baf)

Mantap Http://pavingblockharga.com
