Search code examples
iphoneiostestingbddjasmine

Using Jasmine with iPhone Development?


I'm new to the Jasmine Testing Framework, I want to know how to use this for testing iPhone developments?

How can I integrate with Xcode and use for BDD testing? Will Jasmine only test my JavaScript code?? Then how can I use Jasmine in between my Xcode and call to JavaScript to verify that my JavaScript is valid?

I have already seen many links and examples but all are of these are testing JavaScript. I'm specifically asking only for iPhone. How do you communicate between JavaScript and an XCode Project.


Solution

  • It is not possible to test Objective-C (iPhone) with Jasmine (JavaScript).

    I have used the Appecelerator Titanium to develop an iPhone app -- it allows you to write code in JavaScript which is mapped to a native Objective-C interface. Its the only product so far that actually produces native code (as opposed to PhoneGap and others which run your JS code in an embedded webpage). I used jasmine to test my JavaScript code on the iPhone within my Titanium-built app and it worked great. Even setup was a breeze. I think it was this project that helped: https://github.com/guilhermechapiewski/titanium-jasmine

    If you need to test Objective-C code, Cedar (by Pivotal Labs) is your best bet. You can find Cedar here: https://github.com/pivotal/cedar