Any frameworks available for writing test cases to Support iOS applications developed using Appcelerator Titanium?
2 Answers
There are quite a few frameworks for Unit Testing:
But the most of those frameworks listed above are either discontinued or don’t work anymore. And the frameworks that are still working mostly run in the Titanium container/runtime. This means the Titanium project needs to be build and run first which makes the execution process of your tests very slow. Besides that, most of them don’t provide mocking the Titanium namespace (e.g. manipulating/mocking Ti.Network).
We’re using the TiUnit toolset for our Unit Testing in combination with Istanbul (test/code coverage). TiUnit covers our needs within Unit Testing:
- Fast and execution outside of the Titanium container/runtime
- Mocking all dependencies (e.g. required CommonJS modules)
- Generating a mock for all functions, constants and properties in the Ti namespace (Ti)
- Callback, L macro and $ testing
More information can be found on the TiUnit github page
We recommend ti-mocha (https://github.com/tonylukasavage/ti-mocha) which suited, test cases, supports asserts, skips, advanced validations and many more features.