Jasmine testing framework

If you're looking for a simple BDD framework to test your application, Jasmine might have what you need. Jasmine is a framework-independent BDD library that can be used to run tests on JavaScript applications. It can either be installed through Node.js, or the library can be downloaded and copied to the test project folder.

Jasmine loads its test in an HTML file called a SpecRunner (short for specifications runner). This page loads the main Jasmine library, as well as all the user libraries and unit tests. Once loaded, the Jasmine library runs tests in the browser and displays the results.

Writing tests for Jasmine

Once we have the SpecRunner in place, it's time to write tests. Tests are written using normal JavaScript logic ...

Get Mastering ArcGIS Server Development with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.