BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage Research How Do You Unit Test Your JavaScript Code?

How Do You Unit Test Your JavaScript Code?

Bookmarks

InfoQ's research widget has been deprecated and is no longer available.

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.

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

Community comments

  • Missing some tools

    by Declan Whelan,

    Your message is awaiting moderation. Thank you for participating in the discussion.

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

  • Re: Missing some tools

    by James Chesters,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Well spotted, Declan -- Jasmine has now been added

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

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

BT