Skip to content
UdemyJavaScriptPaid courseAll LevelsCertificate

Learn Javascript Unit Testing With Mocha, Chai and Sinon (Udemy.com)

Learn to write unit tests with Mocha Chai and Sinon as well as learning how to TDD the right way

Created by: Tyler Pedley

Last updated August 2017

icon
What you will learn

  • Write unit tests using Mocha, Chai and Sinon
  • Setup a new project that is ready for unit testing
  • Create programs following the TDD (Test Driven Development) patterns
  • Learn how to write more reliable and robust code
  • Learn how to expand your test suites with mocks, stubs and spies
  • Learn the use of spies and when to use them
  • Learn the use of stubs and when to use them
  • Learn the use of mocks and when to use them

How it compares

Against the other 239 rated Udemy courses in JavaScript on CourseDuck:

  • Rating4.3 out of 5higher than 25% of them
  • Reviews662#103 of 240 by number of reviews
  • Length0.7 hoursshorter than 98% of them
  • Last updatedAugust 2017earlier than 89% of them

icon
Course Description

In this course you will learn the basics of the test driven development workflow and I will show you the best practices for using TDD. You will learn how to use Mocha, Chai and Sinon together to test your Javascript code giving you peace of mind that your code works as expected. After completing this course you will be able to extensively test your nodejs applications and websites. I will also show you each of the different styles for writing unit tests so that you can use the one that you like the best.


Alot of employers are starting to require TDD knowledge and so why not get started here?

icon
Udemy Discount

The discount is applied through our link. Open the course from here and Udemy's current promotional price is applied at checkout on most courses, no code to type.

Some courses are excluded from Udemy's promotions. If the price does not drop, clear your browser cookies and use the button again.

icon
Instructor Details

Tyler Pedley

Hi, My name is Tyler Pedley and I am an embedded software developer however I also lead a team of developers for a company working on multiple web / NodeJS projects. I always develop with agile in mind and have a great experience with agile. Mainly my courses will be on agile practices such as TDD/BDD however I also will teach NodeJs, TypeScript and JavaScript

icon
More JavaScript courses

Free

Free

Free

$24.99

Free

$79.99

icon
Reviews

4.3

662 ratings on Udemy

Select a bar to show only those reviews.Select the bar again to show every rating.

By Somnath Dutta on 4/16/2025

I liked the very short and objective oriented videos and it gives a very quick understanding to someone starting off with Mocha Chai and Sinon or trying to do a revision of one's knowledge. I would like to see the course getting updated with the new features coming up in the Unit Testing Suite libraries. Thanks A Lot for creating the course. Kudos. Good Luck.

By Sylvia Gonschior on 3/26/2020

Der Kurs war super, leider ist der automatisch generierte englische Untertitel falsch, stört dann mehr als er unterstützt, lässt sich aber nicht ausblenden :-( Zumindest habe ich die Funktion nicht gefunden.

By Gina DeBell on 2/10/2019

Instructor was very detailed. I also liked that he was quick and to the point. The course did not contain practice problems which I would have liked but it did contain 'test' questions to check your understanding. I would recommend this course.

By Shaun Kearley on 12/14/2018

Very good course for a very basic introduction to the purpose and basic syntax of test driven development with mocha. However I feel the experience would be improved if a local simple system was used in the examples, especially for the mocks and stubs so that the interaction of the 'fake' code and 'real' code could be more clear. Due to the nature of this material, using fake code to test with fake code becomes confusing. Would recommend to beginners that have no idea of mocha or test driven development with javascript or typescript.

By Nick Kampe on 4/3/2018

Great course content, love the topic. Would really appreciate it if were more comprehensive as I feel just a brief hour overview of TDD could be elaborated on quite a bit. Specifically with testing ES6 classes, particularly stubbing constructors with Sinon. I feel like test setup could be better explained, especially pertaining to suites. Answers to the quiz questions should only have one true answer, as much of the code questions and multiple choices we're for the most part correct. Sinon itself could have it's own course really. Maybe run over the bowling Kata with TDD/BDD to better drive home the examples. Testing strategies with Chia and Sinon could be better explained.

By Bryan Castillo on 2/13/2018

This course is great if you want to get a basic understanding of TDD, but it's not too good if you already have some experience with it. The course needs more projects and examples applicable to the real world, also some exercises are a bit repetitive, but what I loved is the fact that it was taught at a swift pace and it didn't got me bored with excessive explanation, anyways more detail would help. Good Course.

By Elam Daly on 12/28/2017

Save yourself the 20 bucks and simply go to the individual websites for the software api's the author is talking about. This class is nothing more than the most superficial of explanations on how these api's work. While useful, its not very enlightening. It's 40 minutes of video lecture that does nothing more than summarize the basic functions of the packages.

By Jarabe Soft on 10/29/2017

El curso abarca los temas anunciados, sin embargo tengo tres observaciones: 1. De vez en cuando, en pantalla se ven cosas que no se han visto en el curso, como el should.throw( ) etc. que pueden distraer, así como resultados de consola que desconocemos cómo el tutor ha llegado a ellos. Supongo que este último es por edición. 2. Hay muchos casos de uso que te los dejan como para revisar en la documentación, en lugar de practicarlos durante el curso, que podría ser valioso para que el tutor nos dé comentarios útiles. Esto haría más largo y especializado el curso. 3. Se pudo haber usado el ciclo de Rojo, Verde, Refactor en el resto de los temas para practicarlo durante el curso y crearse el hábito en uno mismo. De ahí en más los temas se exponen de manera introductoria con un par de ejemplos cada uno y su exposición es clara.

By Khaled Aman on 9/29/2017

The course was very informative, good exposure to the topic. I would like to see more input on how to resolve issues, I ran into a number of "AssertionError" during the stub and spy sections. Overall, very good course. I would recommend it to anyone trying to expand their knowledge base on Unit Testing with JavaScript.

By maxdevjs . on 8/24/2017

Nice quick introduction to unit tests with Mocha, Chai, Sinon and TDD made the "the right way". Author presents the topics in a clear way and he is responsive in answering questions. Of course, the font size in the videos could be increased for an optimal reading. Despite this, I find it strange that currently there are so few people enrolled in this course: I give five stars because it keeps promises. Finally, would be interesting a further course presenting a non trivial project with TDD.

Showing all 10 reviews on CourseDuck

Read all 662 reviews on Udemy

icon
Quality Score

No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.

Content Quality
/
Video Quality
/
Qualified Instructor
/
Course Pace
/
Course Depth & Coverage
/

Overall Score : 86 / 100