JsUnit
JsUnit is an open source unit testing framework created by Edward Hieat. It is basically used to perform unit testing for client side in browser testing. JsUnit comes with ant tasks, which can be helpful to integrate it with continuous integration server builds.
Getting started
Download the ZIP bundle of JsUnit from http://sourceforge.net/projects/jsunit/files/ or https://github.com/pivotal/jsunit location. Extract ZIP file in any directory, and you will get the jsunit
directory. In this book, we will be using jsunit v2.2
for example. Once you extract the ZIP file, you will get the folder structure shown in the following screenshot:
This folder structure contains example tests for JsUnit in the tests
folder. If we want to start test suite to run the test that we have written, then we need to click on the file called testRunner.html
. Once we click on test runner, we can see screen as shown in the following screenshot:
We can give our test file path in the file:/// field as shown in preceding...