The Web Tub
Published in

The Web Tub

Test your Javascript Code with these Unit Testing Frameworks

Recently we introduced some advantages to using Monaca LocalKit in this blog post. One of the big advantages we pointed out was the ease of automated testing when you use Monaca LocalKit. Let’s take a look at some major JavaScript Unit Testing Frameworks offered by the community!

Jasmine: Behavior-Driven JavaScript

See the GitHub Repository

Jasmine is a testing framework that has a similar syntax to RSpec. For example:

Here we are comparing returned values and expected values with expect function.


See the GitHub Repository

QUnit framework has been around for a while. You might be familiar with their result screen on a web browser. Testing code is as follows:

QUnit was originally developed as a part of jQuery. But a rewrite in 2009 made QUnit run completely standalone.


See the GitHub Repository

Riot.js is a JavaScript implementation of Riot.

It will run on a browser, Rhino, or Node.

Unit testing framework for Javascript — Unit.js

See the GitHub Repository

Unit.js also runs on a browser or Node. It has its own unique syntax.

There is a test variable which contains the Unit.js module. From that variable, you can do various testing like properties, length, RegEx and so on.


See the GitHub Repository

Screw.Unit is Behavior-Driven Testing framework for JavaScript. It has familiar RSpec-like and readable syntax.

Protractor — end to end testing for AngularJS

See the GitHub Repository

Protractor is an E2E test framework for AngularJS. Protractor will be a great choice if you are developing AngularJS applications.

Mocha — the fun, simple, flexible JavaScript test framework

See the GitHub Repository

Mocha is a JavaScript testing framework which makes testing simple and fun. It runs on a browser and on Node. The syntax is similar to Jasmine.


Make sure to cover a variety of tests to deliver your high-quality applications with these testing frameworks. Many of the frameworks we discussed here work with a browser and Node. So remember to do Unit Testing of your JavaScript code when developing Monaca applications!

Moreover, Protractor will be a great choice if you are developing apps with our UI!




Pushing the web current through hybrid mobile and PWA technology. Presented by the Monaca and Onsen UI team.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Onsen UI & Monaca Team

Onsen UI & Monaca Team

Team of developers from Onsen UI and Monaca

More from Medium

Polyfills And Helpers — How To Save Your Bundle Size

HTTP methods / CORS / Preflighted requests

Setting up react test with Jest and Enzyme

Importance of Reading Other’s Code