Unit Testing Web Applications with Intern

Intern is an open source software testing tool for Javascript. It runs tests using the browser or node.js and seamlessly integrates with SauceLabs or Selenium. You can write tests using object, TDD, or BDD styles and get full code coverage reporting with Istanbul. This article by Alvin Liu, Todd Kaplinger and Mingzhe Huang provides a presentation of Intern and explains how to use it to test web applications.

The article starts with a presentation of Intern and provides instructions on how to install it. Then the article explains how to writing test cases with Intern on browser code with detailed explanations. The second part of the article deals with using Intern to test Asynchronous Module Definition (AMD) code. AMD is a JavaScript module specification which is broadly used in many modern web applications and JavaScript libraries, even Intern itself is based on AMD loader. The final part of the article explains how to generate detailed code coverage report from Intern tests in HTML format.

The conclusion of the article is that “Intern is a very powerful and comprehensive testing tool for JavaScript. Although this article only covered the unit test for web application using Intern, Intern is also a tool for FVT and NodeJS application test and can generate code coverage report for you. Intern also provides the native support for CI Integration and a task for Grunt which made you integrate it with your own build system easily.”

Read this multi-part article on www.ibm.com