tonylukasavage / ti-mocha

Simple and reliable support for mocha testing with Appcelerator's Titanium SDK
Other
64 stars 21 forks source link

Testing / Command line questions #29

Closed fmr closed 9 years ago

fmr commented 9 years ago

Hi @tonylukasavage,

I've been looking into testing within the Appcelerator ecosystem, and I always seem to come back to one of your projects, namely ti-mocha.

So, I have a few questions:

My goal is to have an alloy project set up and have tests running on travis-ci. Likewise, I want to create reusable modules installable using gittio, also built and tested on travis-ci.

Any help pointing me in the right direction would be much appreciated. Thanks in advance, and thanks for all your awesome work.

yuchi commented 9 years ago

My goal is to have an alloy project set up and have tests running on travis-ci.

(emphasis by me)

I cannot really help you on the other questions, but I can point you to this .travis.yml that installs all the required dependencies and launches an app in the Travis CI environment.

fmr commented 9 years ago

Thanks @yuchi, that's pretty helpful. I'd love to have some automated tests there, but at the very least with your example I'll know that the project builds fine on Travis.

yuchi commented 9 years ago

Please note that the configuration I linked is iOS only.

I built an experiment that makes tests running in both iOS and Android, both on Travis CI. You can see the resulting runs here: https://travis-ci.org/yuchi/ti-cross-ci-experiments

yuchi commented 9 years ago

@fmr, could you please add a few notes on how you structured your project in the end?

fmr commented 9 years ago

@yuchi, In the end I didn't end up using ti-mocha (or any test framework for that matter, sadly). I know very little of the best practices for testing in the javascript world, much less in Titanium.

What I did manage to get working was your ti-cross-ci-experiments set up. I haven't got any tests, but at least any glaring build errors will come up on Travis for iOS and Android.

I've created a gist for what I've used: https://gist.github.com/fmr/430c45eb93a000ec1f42 A successful build looks like this:

image

I would still love to know how I can integrate ti-mocha or other test frameworks in a mobile app project (not just for commonjs modules, etc.) for use with continuous integration.

fmr commented 9 years ago

Closing this since it's got little to do with ti-mocha now. For anyone interested, this project looks like a good reference for testing and continuous integration: https://github.com/TheSmiths/ts.boilerplate