---
title: "Discussion on \"Testing with Mocha and Chai\" | Hashnode"
description: "Discussion on \"Testing with Mocha and Chai\". Mocha is a JavaScript test framework and Chai is an assertion library that can be paired with any JavaScript testing framework.\nWriting tests in a nutshell consists of checking the code by running it to ensure that the actual output of your code is t..."
url: "https://hashnode.com/posts/testing-mocha-chai/6163388c18374f2573273431"
---

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

Discussion

# [Testing with Mocha and Chai](https://grimreaper.hashnode.dev/testing-mocha-chai?utm_source=hashnode&utm_medium=feed)

Mocha is a JavaScript test framework and Chai is an assertion library that can be paired with any JavaScript testing framework. Writing tests in a nutshell consists of checking the code by running it to ensure that the actual output of your code is t...

Oct 10, 2021 · 4 min read · grimreaper.hashnode.dev  
Read the article

-   [#testing](https://hashnode.com/tag/testing)
-   [#unit-testing](https://hashnode.com/tag/unit-testing)
-   [#mocha](https://hashnode.com/tag/mocha)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Zahra Zadeh](https://hashnode.com/@icycodes)

@icycodes · East Coast, US

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

Front-End React Dev

## Responses 4

Markdown supported · ⌘↵ to post

[Aaron Rebelo](https://hashnode.com/@AaronRebelo)

[Oct 4, 2022](https://hashnode.com/posts/testing-mocha-chai/6163388c18374f2573273431/comment/633bbd3da583d09ac691b7a5)

Just what I needed before I started learning Mocha. Good overview.

[Jide Abdul-Qudus](https://hashnode.com/@jideabdqudus)

[Oct 11, 2021](https://hashnode.com/posts/testing-mocha-chai/6163388c18374f2573273431/comment/6164b82053401f641ba12d11)

I started writing tests to my code a while ago, and I've never looked back. It's quite important in the developmental cycle.

[Zahra Zadeh](https://hashnode.com/@icycodes)

[Oct 13, 2021](https://hashnode.com/posts/testing-mocha-chai/6163388c18374f2573273431/comment/6164b82053401f641ba12d11#reply-6166fdea18374f2573277c72)

Bravo! Testing is so crucial! What testing suite do you use?

[Jide Abdul-Qudus](https://hashnode.com/@jideabdqudus)

[Oct 14, 2021](https://hashnode.com/posts/testing-mocha-chai/6163388c18374f2573273431/comment/6164b82053401f641ba12d11#reply-616825b518374f2573278fdd)

Cypress and the React Testing Library 😊 [Zahra Zadeh](https://hashnode.com/@icycodes)

[Chris Vernon](https://hashnode.com/@CeeDeeVee)

[Oct 11, 2021](https://hashnode.com/posts/testing-mocha-chai/6163388c18374f2573273431/comment/6163cca853401f641ba114ef)

Thanks for this, a really good article. Looking forward to your future content.

[Zahra Zadeh](https://hashnode.com/@icycodes)

[Oct 11, 2021](https://hashnode.com/posts/testing-mocha-chai/6163388c18374f2573273431/comment/6163cca853401f641ba114ef#reply-61646a8318374f2573274d76)

Oh my goodness, thank you Chris!! 🎶

[Sumudu Siriwardana](https://hashnode.com/@sumudusiriwardana)

[Oct 11, 2021](https://hashnode.com/posts/testing-mocha-chai/6163388c18374f2573273431/comment/6163959318374f25732738e6)

Testing is a very important part of development life cycle and I was always wondering about more details on this subject. This is a good write up with details. Learned a lot with valuable details!

[Zahra Zadeh](https://hashnode.com/@icycodes)

[Oct 11, 2021](https://hashnode.com/posts/testing-mocha-chai/6163388c18374f2573273431/comment/6163959318374f25732738e6#reply-61646a6018374f2573274d59)

I agree! When I found out that the majority of the code out there is being shipped to production without a hefty test suite I was: a) shocked b) terrified So many bugs can crawl through the edges without tests! Thank you for your love Sumudu, I feel it, and it feels amazing. 🌟
