BT

How Do You Unit Test Your JavaScript Code?

by James Chesters on Oct 10, 2014 |

Recently, we asked about your JavaScript testing approaches -- if you were testing at all.

Your responses showed, overwhelmingly, that Unit Testing Tools are the most popular approach to JavaScript testing.

(Click on the image to enlarge it)

 

 

 

 

 

 

 

 

 

Now what we’d really like to know is: How Do You Unit Test Your JavaScript Code? Please let us know what unit testing tools you are using.

While there are too many to list every possible framework, we have selected some of the most popular or common.

The options:

  • ​​BrowserSwarm: An open source testing development tool from Microsoft for automated testing of JavaScript frameworks and libraries across devices and browsers
  • Buster.js: ​A Node.js testing toolkit and browser JavaScript testing toolkit that does browser testing with browser automation and QUnit style static HTML page testing, as well as testing in headless browsers.
  • FireUnit: FireUnit provides a simple JavaScript API for test logging and viewing within a new tab of Firebug.
  • Jasmine: an open source testing framework for JavaScript, influenced by other unit testing frameworks, such as ScrewUnit, JSSpec, JSpec, and RSpec.
  • JS Unit: An open source Unit Testing framework for client-side JavaScript, and a platform for automating the execution of tests on multiple browsers and multiple machines running different operating systems.
  • Karma: Karma is a tool that spawns a web server executing source code against test code for connected browsers. Karma examines test results and displays via the command line to the developer.
  • QUnit: A JavaScript unit testing framework for testing jQuery, jQuery UI and jQuery Mobile, and generic JavaScript code, supporting server-side (e.g. node.js) and client-side environments
  • RhinoUnit​: A Javascript Testing Framework using Rhino, Mozilla's open-source implementation of JavaScript
  • TestSwarm: JQuery's distributed continuous integration testing project for JavaScript
  • I don’t test

 

 

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Missing some tools by Declan Whelan

The tools listed (e.g. Jasmine) aren't available to to drag n' drop.

Re: Missing some tools by James Chesters

Well spotted, Declan -- Jasmine has now been added

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

2 Discuss
General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT