Skip to content
Titanium Mobile / Alloy Unit-Testing with Jasmine
JavaScript Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Titanium Mobile Unit-Testing with Jasmine


This package allows you to execute Unit-Tests for Titanium Mobile and Alloy based Apps using Jasmine 2. The tests will be executed in a headless web browser (PhantomJS).


  • Works on Windows, Linux and MacOSX
  • Takes only seconds to execute the tests
  • Auto detection of specification files
  • Works with Alloy (possible to test Models, Controllers, ...)
  • Access to all MobileWeb Titanium APIs, you do not have to mock anything
  • Creates XML files for each test suite
  • Tests won't be packaged within the app
  • You do not need an iOS Simulator or Android Emulator
  • Execute Cross-Domain requests
  • You can extend it for instance to capture screen if any error occurs
  • Works with Travis-CI see


In order to get this work you need to build your application for MobileWeb. Why? Build time is faster, it is platform independent and you don't need to install an iOS/Android-SDK.

  1. Copy the specs folder into your Titanium project
  2. Install PhantomJS.
  3. Done.


Just place your specification files within the /specs folder or any subfolder like models or controller. They must end with _spec.js.

To run the tests simply execute the following command:


If you want to build your application before running the tests, you can do this either using Titanium Studio or using Titanium CLI:

titanium build -p mobileweb



It currently requires that your MobileWeb application runs on a server. The current implementation uses this URL: If you build your app using Titanium Studio this will work out of the box.

3rd-party libraries/components

Name: specs/jasmine/jasmine.js
Name: specs/jasmine/jasmine-html.js
Name: specs/jasmine/boot.js
Name: specs/jasmine/console.js
License: See specs/jasmine/JASMINE.MIT.LICENSE.txt

Something went wrong with that request. Please try again.