Writing and executing unit tests in JavaScript

It's important to develop an application over time and not break functionality later. It doesn't matter if the application was developed with C#, Java, Python, or JavaScript.

There are several client-side unit testing frameworks out there, the most prominent ones being:

  • Jasmine
  • AVA
  • Mocha
  • Jest
  • QUnit

Every testing framework has its ups and downs. We'll use QUnit in this chapter. QUnit was developed by jQuery developers and is used to test jQuery methods. jQuery depends on QUnit not breaking over time, when developers add new functions and break completely non-irrelevant parts of the framework.

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.